summaryrefslogtreecommitdiff
path: root/crypto/scompress.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-12-15 15:51:19 -0800
committerHerbert Xu <herbert@gondor.apana.org.au>2019-12-20 14:58:35 +0800
commit51218bfa6f0bbfdab3df09721a16a55bc1b6da40 (patch)
tree0cf69f9ddfce8625541e31d7b8b6e7d5619df143 /crypto/scompress.c
parente4da805f79b7adedd802488acadd05b598e7edc3 (diff)
downloadlinux-crypto-51218bfa6f0bbfdab3df09721a16a55bc1b6da40.tar.gz
linux-crypto-51218bfa6f0bbfdab3df09721a16a55bc1b6da40.zip
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>
Diffstat (limited to 'crypto/scompress.c')
-rw-r--r--crypto/scompress.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/scompress.c b/crypto/scompress.c
index 4d50750d..738f4f8f 100644
--- a/crypto/scompress.c
+++ b/crypto/scompress.c
@@ -266,9 +266,9 @@ int crypto_register_scomp(struct scomp_alg *alg)
}
EXPORT_SYMBOL_GPL(crypto_register_scomp);
-int crypto_unregister_scomp(struct scomp_alg *alg)
+void crypto_unregister_scomp(struct scomp_alg *alg)
{
- return crypto_unregister_alg(&alg->base);
+ crypto_unregister_alg(&alg->base);
}
EXPORT_SYMBOL_GPL(crypto_unregister_scomp);