[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5589CD95.9080508@users.sourceforge.net>
Date: Tue, 23 Jun 2015 23:20:21 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: "David S. Miller" <davem@...emloft.net>,
Herbert Xu <herbert@...dor.apana.org.au>,
linux-crypto@...r.kernel.org
CC: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH] crypto-jitterentropy: Delete unnecessary checks before the
function call "kzfree"
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 23 Jun 2015 22:30:21 +0200
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@...rs.sourceforge.net>
---
crypto/jitterentropy.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/crypto/jitterentropy.c b/crypto/jitterentropy.c
index d3c3045..22ded3e 100644
--- a/crypto/jitterentropy.c
+++ b/crypto/jitterentropy.c
@@ -698,11 +698,9 @@ static struct rand_data *jent_entropy_collector_alloc(unsigned int osr,
static void jent_entropy_collector_free(struct rand_data *entropy_collector)
{
- if (entropy_collector->mem)
- kzfree(entropy_collector->mem);
+ kzfree(entropy_collector->mem);
entropy_collector->mem = NULL;
- if (entropy_collector)
- kzfree(entropy_collector);
+ kzfree(entropy_collector);
entropy_collector = NULL;
}
--
2.4.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists