diff mbox series

[net,v2] net: fealnx: fix missing pci_disable_device()

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

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 7 maintainers not CCed: petrm@nvidia.com geoff@infradead.org wsa+renesas@sang-engineering.com thomas.lendacky@amd.com edumazet@google.com shayagr@amazon.com pabeni@redhat.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yang Yingliang Oct. 25, 2022, 1:07 p.m. UTC
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(-)

Comments

Jakub Kicinski Oct. 25, 2022, 6:29 p.m. UTC | #1
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 mbox series

Patch

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");
 }