mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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: a85e4c5208
("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>
This commit is contained in:
parent
568035b01c
commit
e79b548b72
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user