Explorar o código

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>
Lothar Waßmann %!s(int64=13) %!d(string=hai) anos
pai
achega
86f9f2c81c
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      drivers/net/ethernet/freescale/fec.c

+ 6 - 2
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) {