summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2015-06-23 22:30:21 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2015-06-25 23:18:33 +0800
commit49d2a5f69e515680bf10cc2e17d89cbe06bc9440 (patch)
treee9f55b4e0f5a401e136c3e4167616e78498e1e60
parent5f029f93c03ae3d66ae949bdd889060c7eb1ed60 (diff)
downloadlinux-crypto-49d2a5f69e515680bf10cc2e17d89cbe06bc9440.tar.gz
linux-crypto-49d2a5f69e515680bf10cc2e17d89cbe06bc9440.zip
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>
-rw-r--r--crypto/jitterentropy.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/jitterentropy.c b/crypto/jitterentropy.c
index 6dfb220b..acf44b2d 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;
}