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: scompress - Use crypto_unregister_scomps in crypto_register_scomps

Replace the for loop with a call to crypto_unregister_scomps(). 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
0e602c5f bb571875

+4 -8
+4 -8
crypto/scompress.c
··· 381 381 382 382 for (i = 0; i < count; i++) { 383 383 ret = crypto_register_scomp(&algs[i]); 384 - if (ret) 385 - goto err; 384 + if (ret) { 385 + crypto_unregister_scomps(algs, i); 386 + return ret; 387 + } 386 388 } 387 389 388 390 return 0; 389 - 390 - err: 391 - for (--i; i >= 0; --i) 392 - crypto_unregister_scomp(&algs[i]); 393 - 394 - return ret; 395 391 } 396 392 EXPORT_SYMBOL_GPL(crypto_register_scomps); 397 393