summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorJia Jie Ho <jiajie.ho@starfivetech.com>2023-12-04 06:02:39 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2023-12-15 12:52:52 +0300
commit555e387047761eb909a0a1a8230efad3fa3e82ca (patch)
tree802770a76110e235bc40e0d429a62e2e9151d609 /drivers/crypto
parent99bd99d3e3a7f73c1c01ef510d48730b3bdd2c4a (diff)
downloadlinux-555e387047761eb909a0a1a8230efad3fa3e82ca.tar.xz
crypto: starfive - Remove unneeded NULL checks
NULL check before kfree_sensitive function is not needed. Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com> Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202311301702.LxswfETY-lkp@intel.com/ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/starfive/jh7110-rsa.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/crypto/starfive/jh7110-rsa.c b/drivers/crypto/starfive/jh7110-rsa.c
index c2b1f598873c..cf8bda7f0855 100644
--- a/drivers/crypto/starfive/jh7110-rsa.c
+++ b/drivers/crypto/starfive/jh7110-rsa.c
@@ -45,12 +45,9 @@ static inline int starfive_pka_wait_done(struct starfive_cryp_ctx *ctx)
static void starfive_rsa_free_key(struct starfive_rsa_key *key)
{
- if (key->d)
- kfree_sensitive(key->d);
- if (key->e)
- kfree_sensitive(key->e);
- if (key->n)
- kfree_sensitive(key->n);
+ kfree_sensitive(key->d);
+ kfree_sensitive(key->e);
+ kfree_sensitive(key->n);
memset(key, 0, sizeof(*key));
}