public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slimbus: qcom: fix error check return value of platform_get_irq()
@ 2022-04-12  9:02 cgel.zte
  2022-04-12 14:29 ` Bjorn Andersson
  2022-04-12 15:01 ` Srinivas Kandagatla
  0 siblings, 2 replies; 3+ messages in thread
From: cgel.zte @ 2022-04-12  9:02 UTC (permalink / raw)
  To: agross, bjorn.andersson, srinivas.kandagatla
  Cc: gregkh, sdharia, linux-arm-msm, alsa-devel, linux-kernel, Lv Ruyi,
	Zeal Robot

From: Lv Ruyi <lv.ruyi@zte.com.cn>

platform_get_irq() return negative value on failure, so null check of
ctrl->irq is incorrect. Fix it by comparing whether it is less than zero.

Fixes: ad7fcbc308b0 ("slimbus: qcom: Add Qualcomm Slimbus controller driver")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/slimbus/qcom-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c
index f04b961b96cd..b2f01e155d77 100644
--- a/drivers/slimbus/qcom-ctrl.c
+++ b/drivers/slimbus/qcom-ctrl.c
@@ -510,7 +510,7 @@ static int qcom_slim_probe(struct platform_device *pdev)
 	}
 
 	ctrl->irq = platform_get_irq(pdev, 0);
-	if (!ctrl->irq) {
+	if (ctrl->irq < 0) {
 		dev_err(&pdev->dev, "no slimbus IRQ\n");
 		return -ENODEV;
 	}
-- 
2.25.1


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

end of thread, other threads:[~2022-04-12 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-12  9:02 [PATCH] slimbus: qcom: fix error check return value of platform_get_irq() cgel.zte
2022-04-12 14:29 ` Bjorn Andersson
2022-04-12 15:01 ` Srinivas Kandagatla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox