Commit 555e3870 authored by Jia Jie Ho's avatar Jia Jie Ho Committed by Herbert Xu

crypto: starfive - Remove unneeded NULL checks

NULL check before kfree_sensitive function is not needed.
Signed-off-by: default avatarJia Jie Ho <jiajie.ho@starfivetech.com>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202311301702.LxswfETY-lkp@intel.com/Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 99bd99d3
...@@ -45,12 +45,9 @@ static inline int starfive_pka_wait_done(struct starfive_cryp_ctx *ctx) ...@@ -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) static void starfive_rsa_free_key(struct starfive_rsa_key *key)
{ {
if (key->d) kfree_sensitive(key->d);
kfree_sensitive(key->d); kfree_sensitive(key->e);
if (key->e) kfree_sensitive(key->n);
kfree_sensitive(key->e);
if (key->n)
kfree_sensitive(key->n);
memset(key, 0, sizeof(*key)); memset(key, 0, sizeof(*key));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment