Message ID | 20221025130751.1075684-1-yangyingliang@huawei.com (mailing list archive) |
---|---|
State | Rejected |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,v2] net: fealnx: fix missing pci_disable_device() | expand |
On Tue, 25 Oct 2022 21:07:51 +0800 Yang Yingliang wrote: > Add missing pci_disable_device() in error path of probe() and remove() path. > > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Suggested-by: Leon Romanovsky <leon@kernel.org> > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> This is pointless, I'm deleting this driver.
diff --git a/drivers/net/ethernet/fealnx.c b/drivers/net/ethernet/fealnx.c index ed18450fd2cc..d72256391d49 100644 --- a/drivers/net/ethernet/fealnx.c +++ b/drivers/net/ethernet/fealnx.c @@ -502,7 +502,8 @@ static int fealnx_init_one(struct pci_dev *pdev, if (len < MIN_REGION_SIZE) { dev_err(&pdev->dev, "region size %ld too small, aborting\n", len); - return -ENODEV; + err = -ENODEV; + goto err_out_disable; } i = pci_request_regions(pdev, boardname); @@ -671,6 +672,8 @@ static int fealnx_init_one(struct pci_dev *pdev, pci_iounmap(pdev, ioaddr); err_out_res: pci_release_regions(pdev); +err_out_disable: + pci_disable_device(pdev); return err; } @@ -690,6 +693,7 @@ static void fealnx_remove_one(struct pci_dev *pdev) pci_iounmap(pdev, np->mem); free_netdev(dev); pci_release_regions(pdev); + pci_disable_device(pdev); } else printk(KERN_ERR "fealnx: remove for unknown device\n"); }
Add missing pci_disable_device() in error path of probe() and remove() path. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Suggested-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- v1 -> v2: Don't use pcim_enable_device(), call pci_disable_device() directly. --- drivers/net/ethernet/fealnx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)