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 |
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 --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; }
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