net/fec: don't free an irq that failed to be requested
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 13 Jan 2011 20:49:05 +0000 (21:49 +0100)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 15 Feb 2011 08:26:28 +0000 (09:26 +0100)
Reported-by: Lothar Waßmann <LW@KARO-elektronics.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
drivers/net/fec.c

index b079826586ef11afb27d8e92b81073932899e962..aa1db8e637cd817efc38db8d61b7b9d115764fb9 100644 (file)
@@ -1409,10 +1409,9 @@ fec_probe(struct platform_device *pdev)
                        break;
                ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev);
                if (ret) {
-                       while (i >= 0) {
+                       while (--i >= 0) {
                                irq = platform_get_irq(pdev, i);
                                free_irq(irq, ndev);
-                               i--;
                        }
                        goto failed_irq;
                }