summaryrefslogtreecommitdiff
path: root/drivers/peci
diff options
context:
space:
mode:
authorLv Ruyi <lv.ruyi@zte.com.cn>2022-04-13 04:04:25 +0300
committerIwona Winiarska <iwona.winiarska@intel.com>2022-08-15 21:31:34 +0300
commite79b548b7202bb3accdfe64f113129a4340bc2f9 (patch)
treec157d7f73b77e711fc080d142780b53942d94a3c /drivers/peci
parent568035b01cfb107af8d2e4bd2fb9aea22cf5b868 (diff)
downloadlinux-e79b548b7202bb3accdfe64f113129a4340bc2f9.tar.xz
peci: aspeed: fix error check return value of platform_get_irq()
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@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> Link: https://lore.kernel.org/r/20220413010425.2534887-1-lv.ruyi@zte.com.cn Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com> Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
Diffstat (limited to 'drivers/peci')
-rw-r--r--drivers/peci/controller/peci-aspeed.c2
1 files changed, 1 insertions, 1 deletions
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,