]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - crypto/ahash.c
crypto: algapi - make unregistration functions return void
authorEric Biggers <ebiggers@google.com>
Sun, 15 Dec 2019 23:51:19 +0000 (15:51 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 20 Dec 2019 06:58:35 +0000 (14:58 +0800)
commitc6d633a927499f35a06455a960ad6b5a59c87c2c
tree3e0ac15490f96bd4e5570f8f2e3613d10caced90
parent0e89640b640d7f726bcbf6903c78257a28e56f3c
crypto: algapi - make unregistration functions return void

Some of the algorithm unregistration functions return -ENOENT when asked
to unregister a non-registered algorithm, while others always return 0
or always return void.  But no users check the return value, except for
two of the bulk unregistration functions which print a message on error
but still always return 0 to their caller, and crypto_del_alg() which
calls crypto_unregister_instance() which always returns 0.

Since unregistering a non-registered algorithm is always a kernel bug
but there isn't anything callers should do to handle this situation at
runtime, let's simplify things by making all the unregistration
functions return void, and moving the error message into
crypto_unregister_alg() and upgrading it to a WARN().

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
12 files changed:
Documentation/crypto/devel-algos.rst
crypto/acompress.c
crypto/ahash.c
crypto/algapi.c
crypto/crypto_user_base.c
crypto/scompress.c
crypto/shash.c
include/crypto/algapi.h
include/crypto/internal/acompress.h
include/crypto/internal/hash.h
include/crypto/internal/scompress.h
include/linux/crypto.h