Skip to content

Commit 99218cb

Browse files
Yuuoniydavem330
authored andcommitted
lib82596: Fix IRQ check in sni_82596_probe
platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: 1159788 ("i825xx: Move the Intel 82586/82593/82596 based drivers") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ea93824 commit 99218cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/i825xx/sni_82596.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ static int sni_82596_probe(struct platform_device *dev)
117117
netdevice->dev_addr[5] = readb(eth_addr + 0x06);
118118
iounmap(eth_addr);
119119

120-
if (!netdevice->irq) {
120+
if (netdevice->irq < 0) {
121121
printk(KERN_ERR "%s: IRQ not found for i82596 at 0x%lx\n",
122122
__FILE__, netdevice->base_addr);
123+
retval = netdevice->irq;
123124
goto probe_failed;
124125
}
125126

0 commit comments

Comments
 (0)