Skip to content

Commit

Permalink
net/fec: don't request invalid IRQ
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lothar Waßmann authored and David S. Miller committed Dec 9, 2011
1 parent 6ea0722 commit 86f9f2c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/net/ethernet/freescale/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 86f9f2c

Please sign in to comment.