From: Markus Elfring Date: Tue, 23 Jun 2015 20:30:21 +0000 (+0200) Subject: crypto: jitterentropy - Delete unnecessary checks before the function call "kzfree" X-Git-Tag: v4.1.12-111.0.20170918_2215~189 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5add9ad11d671960b6094c1ca6b5b752eb1286bc;p=users%2Fjedix%2Flinux-maple.git crypto: jitterentropy - Delete unnecessary checks before the function call "kzfree" 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 Signed-off-by: Herbert Xu (cherry picked from commit cea0a3c305fa348cfad3bae4a226c241720daf55) Signed-off-by: Somasundaram Krishnasamy Reviewed-by: Jack Vogel --- diff --git a/crypto/jitterentropy.c b/crypto/jitterentropy.c index 6dfb220b183cf..acf44b2d2d1d0 100644 --- a/crypto/jitterentropy.c +++ b/crypto/jitterentropy.c @@ -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; }