summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-04-05 03:22:19 +0400
committerBen Hutchings <bhutchings@solarflare.com>2012-05-10 05:22:16 +0400
commit3de4e30196f09ff2c096f2f8e17ebc9adda9db8d (patch)
treedcb1901d793c467fa031046737c3ab12186944eb
parent3dca9d2dc285faf1910d405b65df845cab061356 (diff)
downloadlinux-3de4e30196f09ff2c096f2f8e17ebc9adda9db8d.tar.xz
sfc: Fix missing cleanup in failure path of efx_pci_probe()
We need to clear the private data pointer in the PCI device. Also reorder cleanup in efx_pci_remove() for symmetry. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--drivers/net/ethernet/sfc/efx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 5cc58a3b75ac..8253d2155fe3 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -2497,8 +2497,8 @@ static void efx_pci_remove(struct pci_dev *pci_dev)
efx_fini_io(efx);
netif_dbg(efx, drv, efx->net_dev, "shutdown successful\n");
- pci_set_drvdata(pci_dev, NULL);
efx_fini_struct(efx);
+ pci_set_drvdata(pci_dev, NULL);
free_netdev(efx->net_dev);
};
@@ -2700,6 +2700,7 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,
fail2:
efx_fini_struct(efx);
fail1:
+ pci_set_drvdata(pci_dev, NULL);
WARN_ON(rc > 0);
netif_dbg(efx, drv, efx->net_dev, "initialisation failed. rc=%d\n", rc);
free_netdev(net_dev);