[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20220413010425.2534887-1-lv.ruyi@zte.com.cn>
Date: Wed, 13 Apr 2022 01:04:25 +0000
From: cgel.zte@...il.com
To: iwona.winiarska@...el.com
Cc: andrew@...id.au, cgel.zte@...il.com, jae.hyun.yoo@...ux.intel.com,
joel@....id.au, linux-arm-kernel@...ts.infradead.org,
linux-aspeed@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
lv.ruyi@....com.cn, openbmc@...ts.ozlabs.org,
pierre-louis.bossart@...ux.intel.com,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH v2] peci: aspeed: fix error check return value of platform_get_irq()
From: Lv Ruyi <lv.ruyi@....com.cn>
platform_get_irq() return negative value on failure, so null check of
priv->irq is incorrect. Fix it by comparing whether it is less than zero.
Fixes: a85e4c52086c ("peci: Add peci-aspeed controller driver")
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@....com.cn>
---
v2: prefix the subject with "peci: aspeed:"
---
drivers/peci/controller/peci-aspeed.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/peci/controller/peci-aspeed.c b/drivers/peci/controller/peci-aspeed.c
index 1925ddc13f00..731c5d8f75c6 100644
--- a/drivers/peci/controller/peci-aspeed.c
+++ b/drivers/peci/controller/peci-aspeed.c
@@ -523,7 +523,7 @@ static int aspeed_peci_probe(struct platform_device *pdev)
return PTR_ERR(priv->base);
priv->irq = platform_get_irq(pdev, 0);
- if (!priv->irq)
+ if (priv->irq < 0)
return priv->irq;
ret = devm_request_irq(&pdev->dev, priv->irq, aspeed_peci_irq_handler,
--
2.25.1
Powered by blists - more mailing lists