Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: ahash - Use unregister_ahashes in register_ahashes

Replace the for loop with a call to crypto_unregister_ahashes(). Return
'ret' immediately and remove the goto statement to simplify the error
handling code. No functional changes.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Thorsten Blum and committed by
Herbert Xu
bcc3b3c8 fbbc944b

+4 -8
+4 -8
crypto/ahash.c
··· 1020 1020 1021 1021 for (i = 0; i < count; i++) { 1022 1022 ret = crypto_register_ahash(&algs[i]); 1023 - if (ret) 1024 - goto err; 1023 + if (ret) { 1024 + crypto_unregister_ahashes(algs, i); 1025 + return ret; 1026 + } 1025 1027 } 1026 1028 1027 1029 return 0; 1028 - 1029 - err: 1030 - for (--i; i >= 0; --i) 1031 - crypto_unregister_ahash(&algs[i]); 1032 - 1033 - return ret; 1034 1030 } 1035 1031 EXPORT_SYMBOL_GPL(crypto_register_ahashes); 1036 1032