projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e4b1045
)
ethernet: tulip: fix missing pci_disable_device() on error in tulip_init_one()
author
Yang Yingliang
<yangyingliang@huawei.com>
Fri, 6 May 2022 09:42:50 +0000
(17:42 +0800)
committer
Jakub Kicinski
<kuba@kernel.org>
Mon, 9 May 2022 22:52:38 +0000
(15:52 -0700)
Fix the missing pci_disable_device() before return
from tulip_init_one() in the error handling case.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link:
https://lore.kernel.org/r/20220506094250.3630615-1-yangyingliang@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/dec/tulip/tulip_core.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/dec/tulip/tulip_core.c
b/drivers/net/ethernet/dec/tulip/tulip_core.c
index
79df5a7
..
0040dca
100644
(file)
--- a/
drivers/net/ethernet/dec/tulip/tulip_core.c
+++ b/
drivers/net/ethernet/dec/tulip/tulip_core.c
@@
-1399,8
+1399,10
@@
static int tulip_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* alloc_etherdev ensures aligned and zeroed private structures */
dev = alloc_etherdev (sizeof (*tp));
- if (!dev)
+ if (!dev) {
+ pci_disable_device(pdev);
return -ENOMEM;
+ }
SET_NETDEV_DEV(dev, &pdev->dev);
if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) {
@@
-1785,6
+1787,7
@@
err_out_free_res:
err_out_free_netdev:
free_netdev (dev);
+ pci_disable_device(pdev);
return -ENODEV;
}