* [PATCH] via-rhine: Disable device in error path
@ 2014-03-18 17:14 Roger Luethi
2014-03-19 20:08 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Roger Luethi @ 2014-03-18 17:14 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Huqiu Liu
Currently, via-rhine fails to call pci_disable_device() for errors
in rhine_init_one().
Reported-by: Huqiu Liu <liuhq11@mails.tsinghua.edu.cn>
Signed-off-by: Roger Luethi <rl@hellgate.ch>
---
drivers/net/ethernet/via/via-rhine.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index ef312bc..6ac20a6 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -923,7 +923,7 @@ static int rhine_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (rc) {
dev_err(&pdev->dev,
"32-bit PCI DMA addresses not supported by the card!?\n");
- goto err_out;
+ goto err_out_pci_disable;
}
/* sanity check */
@@ -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)) {
rc = -EIO;
dev_err(&pdev->dev, "Insufficient PCI resources, aborting\n");
- goto err_out;
+ goto err_out_pci_disable;
}
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)
dev = alloc_etherdev(sizeof(struct rhine_private));
if (!dev) {
rc = -ENOMEM;
- goto err_out;
+ goto err_out_pci_disable;
}
SET_NETDEV_DEV(dev, &pdev->dev);
@@ -1084,6 +1084,8 @@ err_out_free_res:
pci_release_regions(pdev);
err_out_free_netdev:
free_netdev(dev);
+err_out_pci_disable:
+ pci_disable_device(pdev);
err_out:
return rc;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] via-rhine: Disable device in error path
2014-03-18 17:14 [PATCH] via-rhine: Disable device in error path Roger Luethi
@ 2014-03-19 20:08 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-03-19 20:08 UTC (permalink / raw)
To: rl; +Cc: netdev, liuhq11
From: Roger Luethi <rl@hellgate.ch>
Date: Tue, 18 Mar 2014 18:14:01 +0100
> Currently, via-rhine fails to call pci_disable_device() for errors
> in rhine_init_one().
>
> Reported-by: Huqiu Liu <liuhq11@mails.tsinghua.edu.cn>
> Signed-off-by: Roger Luethi <rl@hellgate.ch>
Applied, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-03-19 20:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18 17:14 [PATCH] via-rhine: Disable device in error path Roger Luethi
2014-03-19 20:08 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).