aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2015-06-23 16:30:21 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2015-06-25 11:18:33 -0400
commitcea0a3c305fa348cfad3bae4a226c241720daf55 (patch)
tree935aa81b3fe9bcba037b2e9cb32450e8ae4199f9 /crypto
parent338a9de0350c1abd9c9f6a8dacb2ba4d950e0d22 (diff)
crypto: jitterentropy - Delete unnecessary checks before the function call "kzfree"
The kzfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/jitterentropy.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/jitterentropy.c b/crypto/jitterentropy.c
index 6dfb220b183c..acf44b2d2d1d 100644
--- a/crypto/jitterentropy.c
+++ b/crypto/jitterentropy.c
@@ -653,11 +653,9 @@ struct rand_data *jent_entropy_collector_alloc(unsigned int osr,
653 653
654void jent_entropy_collector_free(struct rand_data *entropy_collector) 654void jent_entropy_collector_free(struct rand_data *entropy_collector)
655{ 655{
656 if (entropy_collector->mem) 656 jent_zfree(entropy_collector->mem);
657 jent_zfree(entropy_collector->mem);
658 entropy_collector->mem = NULL; 657 entropy_collector->mem = NULL;
659 if (entropy_collector) 658 jent_zfree(entropy_collector);
660 jent_zfree(entropy_collector);
661 entropy_collector = NULL; 659 entropy_collector = NULL;
662} 660}
663 661