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: rng - Use unregister_rngs in register_rngs

Replace the for loop with a call to crypto_unregister_rngs(). 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
8b3ad414 2ffc1ef4

+4 -8
+4 -8
crypto/rng.c
··· 202 202 203 203 for (i = 0; i < count; i++) { 204 204 ret = crypto_register_rng(algs + i); 205 - if (ret) 206 - goto err; 205 + if (ret) { 206 + crypto_unregister_rngs(algs, i); 207 + return ret; 208 + } 207 209 } 208 210 209 211 return 0; 210 - 211 - err: 212 - for (--i; i >= 0; --i) 213 - crypto_unregister_rng(algs + i); 214 - 215 - return ret; 216 212 } 217 213 EXPORT_SYMBOL_GPL(crypto_register_rngs); 218 214