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: acomp - Use unregister_acomps in register_acomps

Replace the for loop with a call to crypto_unregister_acomps(). 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
fbbc944b 4154f7d3

+4 -8
+4 -8
crypto/acompress.c
··· 337 337 338 338 for (i = 0; i < count; i++) { 339 339 ret = crypto_register_acomp(&algs[i]); 340 - if (ret) 341 - goto err; 340 + if (ret) { 341 + crypto_unregister_acomps(algs, i); 342 + return ret; 343 + } 342 344 } 343 345 344 346 return 0; 345 - 346 - err: 347 - for (--i; i >= 0; --i) 348 - crypto_unregister_acomp(&algs[i]); 349 - 350 - return ret; 351 347 } 352 348 EXPORT_SYMBOL_GPL(crypto_register_acomps); 353 349