From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
To: tonyhuang.sunplus@gmail.com, lhjeff911@gmail.com,
ulf.hansson@linaro.org, dan.carpenter@linaro.org
Cc: arnd@arndb.de, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org, error27@gmail.com,
harshit.m.mogalapalli@oracle.com,
kernel-janitors@vger.kernel.org
Subject: [PATCH next v2 2/2] mmc: sunplus: Fix platform_get_irq() error checking
Date: Wed, 9 Aug 2023 00:18:12 -0700 [thread overview]
Message-ID: <20230809071812.547229-2-harshit.m.mogalapalli@oracle.com> (raw)
In-Reply-To: <20230809071812.547229-1-harshit.m.mogalapalli@oracle.com>
The platform_get_irq() function returns negative error codes on failure.
Fixes: 4e268fed8b18 ("mmc: Add mmc driver for Sunplus SP7021")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/a3829ed3-d827-4b9d-827e-9cc24a3ec3bc@moroto.mountain/
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
v1->v2: Split into two patches as they are doing different things.
This is based on static analysis with smatch, only compile tested.
---
drivers/mmc/host/sunplus-mmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sunplus-mmc.c b/drivers/mmc/host/sunplus-mmc.c
index 2bdebeb1f8e4..e9cb1a57cb75 100644
--- a/drivers/mmc/host/sunplus-mmc.c
+++ b/drivers/mmc/host/sunplus-mmc.c
@@ -885,7 +885,7 @@ static int spmmc_drv_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, PTR_ERR(host->rstc), "rst get fail\n");
host->irq = platform_get_irq(pdev, 0);
- if (host->irq <= 0)
+ if (host->irq < 0)
return host->irq;
ret = devm_request_threaded_irq(&pdev->dev, host->irq,
--
2.39.3
next prev parent reply other threads:[~2023-08-09 7:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-09 7:18 [PATCH next v2 1/2] mmc: sunplus: Fix error handling in spmmc_drv_probe() Harshit Mogalapalli
2023-08-09 7:18 ` Harshit Mogalapalli [this message]
2023-08-09 11:33 ` [PATCH next v2 2/2] mmc: sunplus: Fix platform_get_irq() error checking Ulf Hansson
2023-08-09 11:51 ` Dan Carpenter
2023-08-09 13:41 ` Ulf Hansson
2023-08-09 7:40 ` [PATCH next v2 1/2] mmc: sunplus: Fix error handling in spmmc_drv_probe() Dan Carpenter
2023-08-09 11:08 ` Ulf Hansson
2023-08-09 11:17 ` Ulf Hansson
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=20230809071812.547229-2-harshit.m.mogalapalli@oracle.com \
--to=harshit.m.mogalapalli@oracle.com \
--cc=arnd@arndb.de \
--cc=dan.carpenter@linaro.org \
--cc=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lhjeff911@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=tonyhuang.sunplus@gmail.com \
--cc=ulf.hansson@linaro.org \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®