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: skcipher - Use unregister_skciphers in register_skciphers

Replace the for loop with a call to crypto_unregister_skciphers().
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
5a22716e c29fceca

+4 -8
+4 -8
crypto/skcipher.c
··· 741 741 742 742 for (i = 0; i < count; i++) { 743 743 ret = crypto_register_skcipher(&algs[i]); 744 - if (ret) 745 - goto err; 744 + if (ret) { 745 + crypto_unregister_skciphers(algs, i); 746 + return ret; 747 + } 746 748 } 747 749 748 750 return 0; 749 - 750 - err: 751 - for (--i; i >= 0; --i) 752 - crypto_unregister_skcipher(&algs[i]); 753 - 754 - return ret; 755 751 } 756 752 EXPORT_SYMBOL_GPL(crypto_register_skciphers); 757 753