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: lskcipher - Use unregister_lskciphers in register_lskciphers

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

+4 -8
+4 -8
crypto/lskcipher.c
··· 384 384 385 385 for (i = 0; i < count; i++) { 386 386 ret = crypto_register_lskcipher(&algs[i]); 387 - if (ret) 388 - goto err; 387 + if (ret) { 388 + crypto_unregister_lskciphers(algs, i); 389 + return ret; 390 + } 389 391 } 390 392 391 393 return 0; 392 - 393 - err: 394 - for (--i; i >= 0; --i) 395 - crypto_unregister_lskcipher(&algs[i]); 396 - 397 - return ret; 398 394 } 399 395 EXPORT_SYMBOL_GPL(crypto_register_lskciphers); 400 396