summaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2018-09-21 15:30:15 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2018-09-28 06:46:27 +0200
commit79517e8f8e6dddd2a90517123ffdb366828b69f5 (patch)
tree8141f83577defc6e94a3023537720991ac7e2845 /drivers/crypto
parentcrypto: cavium/nitrox - updated debugfs information. (diff)
downloadlinux-79517e8f8e6dddd2a90517123ffdb366828b69f5.tar.xz
linux-79517e8f8e6dddd2a90517123ffdb366828b69f5.zip
crypto: cavium - remove redundant null pointer check before kfree
kfree has taken the null pointer into account. hence it is safe to remove the redundant null pointer check before kfree. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/cavium/cpt/cptvf_reqmanager.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/crypto/cavium/cpt/cptvf_reqmanager.c b/drivers/crypto/cavium/cpt/cptvf_reqmanager.c
index b0ba4331944b..ca549c5dc08e 100644
--- a/drivers/crypto/cavium/cpt/cptvf_reqmanager.c
+++ b/drivers/crypto/cavium/cpt/cptvf_reqmanager.c
@@ -308,21 +308,11 @@ void do_request_cleanup(struct cpt_vf *cptvf,
}
}
- if (info->scatter_components)
- kzfree(info->scatter_components);
-
- if (info->gather_components)
- kzfree(info->gather_components);
-
- if (info->out_buffer)
- kzfree(info->out_buffer);
-
- if (info->in_buffer)
- kzfree(info->in_buffer);
-
- if (info->completion_addr)
- kzfree((void *)info->completion_addr);
-
+ kzfree(info->scatter_components);
+ kzfree(info->gather_components);
+ kzfree(info->out_buffer);
+ kzfree(info->in_buffer);
+ kzfree((void *)info->completion_addr);
kzfree(info);
}