]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
crypto: jitterentropy - Delete unnecessary checks before the function call "kzfree"
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 23 Jun 2015 20:30:21 +0000 (22:30 +0200)
committerSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Wed, 13 Sep 2017 21:21:35 +0000 (14:21 -0700)
Orabug: 26330509

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>
(cherry picked from commit cea0a3c305fa348cfad3bae4a226c241720daf55)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
crypto/jitterentropy.c

index 6dfb220b183cf69790a861c2908146904daefceb..acf44b2d2d1d04bbcf599c449fb7079f698baa65 100644 (file)
@@ -653,11 +653,9 @@ struct rand_data *jent_entropy_collector_alloc(unsigned int osr,
 
 void jent_entropy_collector_free(struct rand_data *entropy_collector)
 {
-       if (entropy_collector->mem)
-               jent_zfree(entropy_collector->mem);
+       jent_zfree(entropy_collector->mem);
        entropy_collector->mem = NULL;
-       if (entropy_collector)
-               jent_zfree(entropy_collector);
+       jent_zfree(entropy_collector);
        entropy_collector = NULL;
 }