All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: octeontx2 - uninitialized variable in kvf_limits_store()
@ 2021-11-27 14:10 Dan Carpenter
  2021-12-03  5:07 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-11-27 14:10 UTC (permalink / raw)
  To: Boris Brezillon, Srujana Challa
  Cc: Arnaud Ebalard, Herbert Xu, Suheil Chandran, Lukasz Bartosik,
	linux-crypto, kernel-janitors

If kstrtoint() fails then "lfs_num" is uninitialized and the warning
doesn't make any sense.  Just delete it.

Fixes: 8ec8015a3168 ("crypto: octeontx2 - add support to process the crypto request")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c b/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
index 146a55ac4b9b..be1ad55a208f 100644
--- a/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
+++ b/drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
@@ -494,12 +494,11 @@ static ssize_t kvf_limits_store(struct device *dev,
 {
 	struct otx2_cptpf_dev *cptpf = dev_get_drvdata(dev);
 	int lfs_num;
+	int ret;
 
-	if (kstrtoint(buf, 0, &lfs_num)) {
-		dev_err(dev, "lfs count %d must be in range [1 - %d]\n",
-			lfs_num, num_online_cpus());
-		return -EINVAL;
-	}
+	ret = kstrtoint(buf, 0, &lfs_num);
+	if (ret)
+		return ret;
 	if (lfs_num < 1 || lfs_num > num_online_cpus()) {
 		dev_err(dev, "lfs count %d must be in range [1 - %d]\n",
 			lfs_num, num_online_cpus());
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: octeontx2 - uninitialized variable in kvf_limits_store()
  2021-11-27 14:10 [PATCH] crypto: octeontx2 - uninitialized variable in kvf_limits_store() Dan Carpenter
@ 2021-12-03  5:07 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2021-12-03  5:07 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Boris Brezillon, Srujana Challa, Arnaud Ebalard, Suheil Chandran,
	Lukasz Bartosik, linux-crypto, kernel-janitors

On Sat, Nov 27, 2021 at 05:10:27PM +0300, Dan Carpenter wrote:
> If kstrtoint() fails then "lfs_num" is uninitialized and the warning
> doesn't make any sense.  Just delete it.
> 
> Fixes: 8ec8015a3168 ("crypto: octeontx2 - add support to process the crypto request")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-03  5:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-27 14:10 [PATCH] crypto: octeontx2 - uninitialized variable in kvf_limits_store() Dan Carpenter
2021-12-03  5:07 ` Herbert Xu

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.