* [PATCH] crypto: starfive: Remove unneeded NULL checks
@ 2023-12-04 3:02 Jia Jie Ho
2023-12-15 9:55 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Jia Jie Ho @ 2023-12-04 3:02 UTC (permalink / raw)
To: Herbert Xu, David S . Miller, linux-crypto, linux-kernel
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/
---
drivers/crypto/starfive/jh7110-rsa.c | 9 +++------
1 file 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));
}
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: starfive: Remove unneeded NULL checks
2023-12-04 3:02 [PATCH] crypto: starfive: Remove unneeded NULL checks Jia Jie Ho
@ 2023-12-15 9:55 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2023-12-15 9:55 UTC (permalink / raw)
To: Jia Jie Ho; +Cc: David S . Miller, linux-crypto, linux-kernel
On Mon, Dec 04, 2023 at 11:02:39AM +0800, Jia Jie Ho wrote:
> 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/
> ---
> drivers/crypto/starfive/jh7110-rsa.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-15 10:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-04 3:02 [PATCH] crypto: starfive: Remove unneeded NULL checks Jia Jie Ho
2023-12-15 9:55 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®