diff options
author | Lv Ruyi <lv.ruyi@zte.com.cn> | 2022-04-12 10:51:26 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-04-12 23:59:42 +0200 |
commit | f45ba67eb74ab4b775616af731bdf8944afce3f1 (patch) | |
tree | 1864da2fbe83608c76fd4699d772b58349d17fd7 /drivers/net/ethernet/xscale | |
parent | net: ethernet: ti: cpsw: using pm_runtime_resume_and_get instead of pm_runtim... (diff) | |
download | linux-f45ba67eb74ab4b775616af731bdf8944afce3f1.tar.xz linux-f45ba67eb74ab4b775616af731bdf8944afce3f1.zip |
ixp4xx_eth: fix error check return value of platform_get_irq()
platform_get_irq() return negative value on failure, so null check of
return value is incorrect. Fix it by comparing whether it is less than
zero.
Fixes: 9055a2f59162 ("ixp4xx_eth: make ptp support a platform driver")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220412085126.2532924-1-lv.ruyi@zte.com.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/xscale')
-rw-r--r-- | drivers/net/ethernet/xscale/ptp_ixp46x.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/xscale/ptp_ixp46x.c b/drivers/net/ethernet/xscale/ptp_ixp46x.c index 1f382777aa5a..9abbdb71e629 100644 --- a/drivers/net/ethernet/xscale/ptp_ixp46x.c +++ b/drivers/net/ethernet/xscale/ptp_ixp46x.c @@ -271,7 +271,7 @@ static int ptp_ixp_probe(struct platform_device *pdev) ixp_clock.master_irq = platform_get_irq(pdev, 0); ixp_clock.slave_irq = platform_get_irq(pdev, 1); if (IS_ERR(ixp_clock.regs) || - !ixp_clock.master_irq || !ixp_clock.slave_irq) + ixp_clock.master_irq < 0 || ixp_clock.slave_irq < 0) return -ENXIO; ixp_clock.caps = ptp_ixp_caps; |