diff options
author | Toke Høiland-Jørgensen <[email protected]> | 2023-03-13 10:17:24 +0100 |
---|---|---|
committer | Herbert Xu <[email protected]> | 2023-03-24 18:22:28 +0800 |
commit | a543ada7db729514ddd3ba4efa45f4c7b802ad85 (patch) | |
tree | 7e04bd96bcd1b3b4019150a373a2f06ce94b56f2 /drivers/fpga/tests/fpga-mgr-test.c | |
parent | e6af5c0c4d32a27e04a56f29aad587e03ff427f1 (diff) |
crypto: api - Demote BUG_ON() in crypto_unregister_alg() to a WARN_ON()
The crypto_unregister_alg() function expects callers to ensure that any
algorithm that is unregistered has a refcnt of exactly 1, and issues a
BUG_ON() if this is not the case. However, there are in fact drivers that
will call crypto_unregister_alg() without ensuring that the refcnt has been
lowered first, most notably on system shutdown. This causes the BUG_ON() to
trigger, which prevents a clean shutdown and hangs the system.
To avoid such hangs on shutdown, demote the BUG_ON() in
crypto_unregister_alg() to a WARN_ON() with early return. Cc stable because
this problem was observed on a 6.2 kernel, cf the link below.
Link: https://lore.kernel.org/r/[email protected]
Cc: [email protected]
Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Diffstat (limited to 'drivers/fpga/tests/fpga-mgr-test.c')
0 files changed, 0 insertions, 0 deletions