summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@163.com>2014-12-23 06:29:03 +0300
committerDavid S. Miller <davem@davemloft.net>2014-12-27 10:20:55 +0300
commiteb69c5bf8273edbe1c5c748fa299b5e5a08f35d6 (patch)
tree3681c575923fad64885a4023790ade0588ce785d /drivers/net
parenta22a9e4141474b9f314947f159817050a1db58d8 (diff)
downloadlinux-eb69c5bf8273edbe1c5c748fa299b5e5a08f35d6.tar.xz
ne2k-pci: Add pci_disable_device in error handling
For linux-3.18.0 The driver lacks pci_disable_device in error handling code of ne2k_pci_init_one, so the device enabled by pci_enable_device is not disabled when errors occur. This patch fixes this problem. Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/8390/ne2k-pci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/8390/ne2k-pci.c b/drivers/net/ethernet/8390/ne2k-pci.c
index 89c8d9fc97de..57e97910c728 100644
--- a/drivers/net/ethernet/8390/ne2k-pci.c
+++ b/drivers/net/ethernet/8390/ne2k-pci.c
@@ -246,13 +246,13 @@ static int ne2k_pci_init_one(struct pci_dev *pdev,
if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) {
dev_err(&pdev->dev, "no I/O resource at PCI BAR #0\n");
- return -ENODEV;
+ goto err_out;
}
if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) {
dev_err(&pdev->dev, "I/O resource 0x%x @ 0x%lx busy\n",
NE_IO_EXTENT, ioaddr);
- return -EBUSY;
+ goto err_out;
}
reg0 = inb(ioaddr);
@@ -392,6 +392,8 @@ err_out_free_netdev:
free_netdev (dev);
err_out_free_res:
release_region (ioaddr, NE_IO_EXTENT);
+err_out:
+ pci_disable_device(pdev);
return -ENODEV;
}