Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb69c5bf authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by David S. Miller
Browse files

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: default avatarJia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a22a9e41
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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 @@ static int ne2k_pci_init_one(struct pci_dev *pdev,
	free_netdev (dev);
err_out_free_res:
	release_region (ioaddr, NE_IO_EXTENT);
err_out:
	pci_disable_device(pdev);
	return -ENODEV;
}