summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimanshu Jha <himanshujha199640@gmail.com>2017-08-27 02:45:29 +0530
committerHerbert Xu <herbert@gondor.apana.org.au>2017-09-22 17:43:25 +0800
commitb8d3de85acb4434fb7fd5e7dee12204a55ff8fc2 (patch)
tree76fbdd568fe6c125d4c8d24d45c33b829c71d339
parent16d5cee5cf65ff704e59a1e70fa82bf798b5e75e (diff)
crypto: n2 - remove null check before kfree
kfree on NULL pointer is a no-op and therefore checking it is redundant. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/n2_core.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c
index a9fd8b9e86cd..48de52cf2ecc 100644
--- a/drivers/crypto/n2_core.c
+++ b/drivers/crypto/n2_core.c
@@ -1962,10 +1962,8 @@ static struct n2_crypto *alloc_n2cp(void)
static void free_n2cp(struct n2_crypto *np)
{
- if (np->cwq_info.ino_table) {
- kfree(np->cwq_info.ino_table);
- np->cwq_info.ino_table = NULL;
- }
+ kfree(np->cwq_info.ino_table);
+ np->cwq_info.ino_table = NULL;
kfree(np);
}
@@ -2079,10 +2077,8 @@ static struct n2_mau *alloc_ncp(void)
static void free_ncp(struct n2_mau *mp)
{
- if (mp->mau_info.ino_table) {
- kfree(mp->mau_info.ino_table);
- mp->mau_info.ino_table = NULL;
- }
+ kfree(mp->mau_info.ino_table);
+ mp->mau_info.ino_table = NULL;
kfree(mp);
}