diff options
author | Lothar Waßmann <LW@KARO-electronics.de> | 2011-12-07 21:59:28 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-08 19:51:20 -0500 |
commit | 86f9f2c81c44223b1be129d0b15cf6edac2a5278 (patch) | |
tree | da0ba2ebf0c897484d10b0a155caa1e194f4e06f /drivers | |
parent | 6ea0722fb8cdeacc774733c259d33bf45529e91b (diff) |
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>
Diffstat (limited to 'drivers')
-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 7ef408fd322a..e2b5ce6efa20 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) { |