From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> To: Herbert Xu <herbert@gondor.apana.org.au>, "David S. Miller" <davem@davemloft.net>, Nicolas Ferre <nicolas.ferre@microchip.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Claudiu Beznea <claudiu.beznea@microchip.com> Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 1/2] crypto: atmel-sha204a: Remove useless check Date: Thu, 28 Apr 2022 19:11:45 +0200 [thread overview] Message-ID: <20220428171146.188331-1-u.kleine-koenig@pengutronix.de> (raw) 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(-) 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
WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de> To: Herbert Xu <herbert@gondor.apana.org.au>, "David S. Miller" <davem@davemloft.net>, Nicolas Ferre <nicolas.ferre@microchip.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Claudiu Beznea <claudiu.beznea@microchip.com> Cc: linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 1/2] crypto: atmel-sha204a: Remove useless check Date: Thu, 28 Apr 2022 19:11:45 +0200 [thread overview] Message-ID: <20220428171146.188331-1-u.kleine-koenig@pengutronix.de> (raw) 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(-) 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2022-04-28 17:12 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-28 17:11 Uwe Kleine-König [this message] 2022-04-28 17:11 ` [PATCH 1/2] crypto: atmel-sha204a: Remove useless check Uwe Kleine-König 2022-04-28 17:11 ` [PATCH 2/2] crypto: atmel-sha204a: Suppress duplicate error message Uwe Kleine-König 2022-04-28 17:11 ` Uwe Kleine-König 2022-05-06 10:21 ` [PATCH 1/2] crypto: atmel-sha204a: Remove useless check Herbert Xu 2022-05-06 10:21 ` Herbert Xu
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220428171146.188331-1-u.kleine-koenig@pengutronix.de \ --to=u.kleine-koenig@pengutronix.de \ --cc=alexandre.belloni@bootlin.com \ --cc=claudiu.beznea@microchip.com \ --cc=davem@davemloft.net \ --cc=herbert@gondor.apana.org.au \ --cc=kernel@pengutronix.de \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-crypto@vger.kernel.org \ --cc=nicolas.ferre@microchip.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.