aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2012-05-29 09:43:34 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-29 22:31:08 -0400
commit20571d8894d1ee5a181e34e8d07ed8472acd30c4 (patch)
treea5c3dc1258b3ae81aee1476c2d8f4b0b2d06aa12 /drivers/net
parentacaf8276823302983d681c2cedaaf01918406935 (diff)
r6040: Do a Proper deinit at errorpath and also when driver unloads (calling r6040_remove_one)
so if mdiobus_alloc fails, the errorpath doesnt do a netif_napi_del and also doesn't set the priv data of the driver to NULL. at the driver unload stage the driver doesn't remove the NAPI context, and doesnt' set the priv data to NULL, and also doesn't call the pci_iounmap. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/rdc/r6040.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
index f5e6f1f4f474..d1827e887f4e 100644
--- a/drivers/net/ethernet/rdc/r6040.c
+++ b/drivers/net/ethernet/rdc/r6040.c
@@ -1233,6 +1233,8 @@ err_out_mdio_irq:
1233err_out_mdio: 1233err_out_mdio:
1234 mdiobus_free(lp->mii_bus); 1234 mdiobus_free(lp->mii_bus);
1235err_out_unmap: 1235err_out_unmap:
1236 netif_napi_del(&lp->napi);
1237 pci_set_drvdata(pdev, NULL);
1236 pci_iounmap(pdev, ioaddr); 1238 pci_iounmap(pdev, ioaddr);
1237err_out_free_res: 1239err_out_free_res:
1238 pci_release_regions(pdev); 1240 pci_release_regions(pdev);
@@ -1253,6 +1255,9 @@ static void __devexit r6040_remove_one(struct pci_dev *pdev)
1253 mdiobus_unregister(lp->mii_bus); 1255 mdiobus_unregister(lp->mii_bus);
1254 kfree(lp->mii_bus->irq); 1256 kfree(lp->mii_bus->irq);
1255 mdiobus_free(lp->mii_bus); 1257 mdiobus_free(lp->mii_bus);
1258 netif_napi_del(&lp->napi);
1259 pci_set_drvdata(pdev, NULL);
1260 pci_iounmap(pdev, lp->base);
1256 pci_release_regions(pdev); 1261 pci_release_regions(pdev);
1257 free_netdev(dev); 1262 free_netdev(dev);
1258 pci_disable_device(pdev); 1263 pci_disable_device(pdev);