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>
This commit is contained in:
parent
6ea0722fb8
commit
86f9f2c81c
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue