diff mbox series

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

Message ID 20220428171146.188331-1-u.kleine-koenig@pengutronix.de
State Accepted
Commit 384e9aa77ae6b0575631ea3100563a9fe44b0e77
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
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;
 }