2022-04-28 23:14:53

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH 1/2] crypto: atmel-sha204a: Remove useless check

kfree(NULL) is a noop, so there is no win in checking a pointer before
kfreeing it.

Signed-off-by: Uwe Kleine-König <[email protected]>
---
drivers/crypto/atmel-sha204a.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

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

base-commit: 3123109284176b1532874591f7c81f3837bbdc17
--
2.35.1