Commit ae996154 authored by Roger Luethi's avatar Roger Luethi Committed by David S. Miller

via-rhine: Disable device in error path

Currently, via-rhine fails to call pci_disable_device() for errors
in rhine_init_one().
Reported-by: default avatarHuqiu Liu <liuhq11@mails.tsinghua.edu.cn>
Signed-off-by: default avatarRoger Luethi <rl@hellgate.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3e3d3540
...@@ -923,7 +923,7 @@ static int rhine_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -923,7 +923,7 @@ static int rhine_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc) { if (rc) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"32-bit PCI DMA addresses not supported by the card!?\n"); "32-bit PCI DMA addresses not supported by the card!?\n");
goto err_out; goto err_out_pci_disable;
} }
/* sanity check */ /* sanity check */
...@@ -931,7 +931,7 @@ static int rhine_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -931,7 +931,7 @@ static int rhine_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
(pci_resource_len(pdev, 1) < io_size)) { (pci_resource_len(pdev, 1) < io_size)) {
rc = -EIO; rc = -EIO;
dev_err(&pdev->dev, "Insufficient PCI resources, aborting\n"); dev_err(&pdev->dev, "Insufficient PCI resources, aborting\n");
goto err_out; goto err_out_pci_disable;
} }
pioaddr = pci_resource_start(pdev, 0); pioaddr = pci_resource_start(pdev, 0);
...@@ -942,7 +942,7 @@ static int rhine_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -942,7 +942,7 @@ static int rhine_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
dev = alloc_etherdev(sizeof(struct rhine_private)); dev = alloc_etherdev(sizeof(struct rhine_private));
if (!dev) { if (!dev) {
rc = -ENOMEM; rc = -ENOMEM;
goto err_out; goto err_out_pci_disable;
} }
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
...@@ -1084,6 +1084,8 @@ static int rhine_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1084,6 +1084,8 @@ static int rhine_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_release_regions(pdev); pci_release_regions(pdev);
err_out_free_netdev: err_out_free_netdev:
free_netdev(dev); free_netdev(dev);
err_out_pci_disable:
pci_disable_device(pdev);
err_out: err_out:
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment