From: Michael Schmitz <schm...@debian.org>

Unregister and free up mdiobus resources if ax_mii_init() failed.

Signed-off-by: Michael Karcher <ker...@mkarcher.dialup.fu-berlin.de>
Signed-off-by: Michael Schmitz <schmitz...@gmail.com>
---
 drivers/net/ethernet/8390/ax88796.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/8390/ax88796.c 
b/drivers/net/ethernet/8390/ax88796.c
index b09cdc6..6af9aca 100644
--- a/drivers/net/ethernet/8390/ax88796.c
+++ b/drivers/net/ethernet/8390/ax88796.c
@@ -415,7 +415,7 @@ static int ax_open(struct net_device *dev)
 
        ret = ax_mii_init(dev);
        if (ret)
-               goto failed_request_irq;
+               goto failed_mii;
 
        if (ax->plat->check_irq)
                ret = request_irq(dev->irq, ax_ei_interrupt_filtered,
@@ -448,6 +448,10 @@ static int ax_open(struct net_device *dev)
        ax_phy_switch(dev, 0);
        free_irq(dev->irq, dev);
  failed_request_irq:
+       /* unregister mdiobus */
+       mdiobus_unregister(ax->mii_bus);
+       free_mdio_bitbang(ax->mii_bus);
+ failed_mii:
        return ret;
 }
 
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to