diff options
author | Lothar Waßmann <LW@KARO-electronics.de> | 2011-12-07 21:59:28 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-09 00:51:20 (GMT) |
commit | 86f9f2c81c44223b1be129d0b15cf6edac2a5278 (patch) | |
tree | da0ba2ebf0c897484d10b0a155caa1e194f4e06f | |
parent | 6ea0722fb8cdeacc774733c259d33bf45529e91b (diff) | |
download | linux-86f9f2c81c44223b1be129d0b15cf6edac2a5278.tar.xz |
net/fec: don't request invalid IRQ
prevent calling request_irq() with a known invalid IRQ number and
preserve the return value of the platform_get_irq() function
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/freescale/fec.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c index 7ef408f..e2b5ce6 100644 --- a/drivers/net/ethernet/freescale/fec.c +++ b/drivers/net/ethernet/freescale/fec.c @@ -1575,8 +1575,12 @@ fec_probe(struct platform_device *pdev) for (i = 0; i < FEC_IRQ_NUM; i++) { irq = platform_get_irq(pdev, i); - if (i && irq < 0) - break; + if (irq < 0) { + if (i) + break; + ret = irq; + goto failed_irq; + } ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev); if (ret) { while (--i >= 0) { |