fec: Invert the order of error path sequence
authorFabio Estevam <fabio.estevam@freescale.com>
Mon, 27 May 2013 03:48:30 +0000 (03:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 May 2013 05:29:54 +0000 (22:29 -0700)
Currently when fec_enet_init fails it jumps to 'failed_init' error path, which
will attemp to free the interrupts.

This is wrong because at this point the interrupts have not even been acquired.

Swap failed_init/failed_irq to fix the error path.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index 57ac7c3453d628d39f52389a400b486849f55818..dc7388ed40e706da52d9c9df7cd3221b5aa59c43 100644 (file)
@@ -1975,13 +1975,13 @@ fec_probe(struct platform_device *pdev)
 failed_register:
        fec_enet_mii_remove(fep);
 failed_mii_init:
-failed_init:
+failed_irq:
        for (i = 0; i < FEC_IRQ_NUM; i++) {
                irq = platform_get_irq(pdev, i);
                if (irq > 0)
                        free_irq(irq, ndev);
        }
-failed_irq:
+failed_init:
 failed_regulator:
        clk_disable_unprepare(fep->clk_ahb);
        clk_disable_unprepare(fep->clk_ipg);