Skip to content

Commit

Permalink
peci: aspeed: fix error check return value of platform_get_irq()
Browse files Browse the repository at this point in the history
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: a85e4c5 ("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>
  • Loading branch information
Lv Ruyi authored and Iwona Winiarska committed Aug 15, 2022
1 parent 568035b commit e79b548
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/peci/controller/peci-aspeed.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e79b548

Please sign in to comment.