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: shash - Use unregister_shashes in register_shashes

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

+4 -8
+4 -8
crypto/shash.c
··· 542 542 543 543 for (i = 0; i < count; i++) { 544 544 ret = crypto_register_shash(&algs[i]); 545 - if (ret) 546 - goto err; 545 + if (ret) { 546 + crypto_unregister_shashes(algs, i); 547 + return ret; 548 + } 547 549 } 548 550 549 551 return 0; 550 - 551 - err: 552 - for (--i; i >= 0; --i) 553 - crypto_unregister_shash(&algs[i]); 554 - 555 - return ret; 556 552 } 557 553 EXPORT_SYMBOL_GPL(crypto_register_shashes); 558 554