diff mbox series

[1/2] crypto: atmel-sha204a: Remove useless check

Message ID 20220428171146.188331-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series [1/2] crypto: atmel-sha204a: Remove useless check | expand

Commit Message

Uwe Kleine-König April 28, 2022, 5:11 p.m. UTC
kfree(NULL) is a noop, so there is no win in checking a pointer before
kfreeing it.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/crypto/atmel-sha204a.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)


base-commit: 3123109284176b1532874591f7c81f3837bbdc17

Comments

Herbert Xu May 6, 2022, 10:21 a.m. UTC | #1
On Thu, Apr 28, 2022 at 07:11:45PM +0200, Uwe Kleine-König wrote:
> kfree(NULL) is a noop, so there is no win in checking a pointer before
> kfreeing it.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/crypto/atmel-sha204a.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

All applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/atmel-sha204a.c b/drivers/crypto/atmel-sha204a.c
index c96c14e7dab1..c71fc86eb849 100644
--- a/drivers/crypto/atmel-sha204a.c
+++ b/drivers/crypto/atmel-sha204a.c
@@ -125,8 +125,7 @@  static int atmel_sha204a_remove(struct i2c_client *client)
 		return -EBUSY;
 	}
 
-	if (i2c_priv->hwrng.priv)
-		kfree((void *)i2c_priv->hwrng.priv);
+	kfree((void *)i2c_priv->hwrng.priv);
 
 	return 0;
 }