[PATCH net v2] net/qla3xxx: disable the PCI device on remove

Subsystems: networking drivers, qlogic qla3xxx network driver, the rest

COLD23d

3 messages, 3 authors, 23d ago · open the first message on its own page

[PATCH net v2] net/qla3xxx: disable the PCI device on remove

From: Myeonghun Pak <hidden>
Date: 2026-09-13 20:45:50

ql3xxx_probe() enables the PCI device and balances that reference on
probe failure. However, ql3xxx_remove() releases the mappings and PCI
regions without disabling the device, leaving the enable reference
held after unbind.

Add pci_disable_device() at the end of ql3xxx_remove() to balance the
successful probe's pci_enable_device() call. Keep the existing manual
cleanup and probe error handling unchanged.

This issue was identified during our ongoing static-analysis research while
reviewing kernel code.

Fixes: 5a4faa873782 ("[PATCH] qla3xxx NIC driver")
Co-developed-by: Ijae Kim <redacted>
Signed-off-by: Ijae Kim <redacted>
Signed-off-by: Myeonghun Pak <redacted>
---
v2:
  - Add pci_disable_device() to ql3xxx_remove() instead of converting
    to pcim_enable_device(), as suggested by Simon Horman.
v1: https://lore.kernel.org/netdev/20260911033219.34566-1-mhun512@gmail.com/

 drivers/net/ethernet/qlogic/qla3xxx.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
@@ -3916,6 +3916,7 @@ static void ql3xxx_remove(struct pci_dev *pdev)
 	iounmap(qdev->mem_map_registers);
 	pci_release_regions(pdev);
 	free_netdev(ndev);
+	pci_disable_device(pdev);
 }
 
 static struct pci_driver ql3xxx_driver = {
-- 
2.53.0

Re: [PATCH net v2] net/qla3xxx: disable the PCI device on remove

From: Simon Horman <horms@kernel.org>
Date: 2026-09-15 09:35:08

On Sun, Sep 13, 2026 at 04:45:34PM -0400, Myeonghun Pak wrote:
ql3xxx_probe() enables the PCI device and balances that reference on
probe failure. However, ql3xxx_remove() releases the mappings and PCI
regions without disabling the device, leaving the enable reference
held after unbind.

Add pci_disable_device() at the end of ql3xxx_remove() to balance the
successful probe's pci_enable_device() call. Keep the existing manual
cleanup and probe error handling unchanged.

This issue was identified during our ongoing static-analysis research while
reviewing kernel code.

Fixes: 5a4faa873782 ("[PATCH] qla3xxx NIC driver")
Co-developed-by: Ijae Kim <redacted>
Signed-off-by: Ijae Kim <redacted>
Signed-off-by: Myeonghun Pak <redacted>
---
v2:
  - Add pci_disable_device() to ql3xxx_remove() instead of converting
    to pcim_enable_device(), as suggested by Simon Horman.
v1: https://lore.kernel.org/netdev/20260911033219.34566-1-mhun512@gmail.com/
Thanks for the update.

Reviewed-by: Simon Horman <horms@kernel.org>

Re: [PATCH net v2] net/qla3xxx: disable the PCI device on remove

From: patchwork-bot+netdevbpf@kernel.org
Date: 2026-09-16 00:51:13

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski [off-list ref]:

On Sun, 13 Sep 2026 16:45:34 -0400 you wrote:
ql3xxx_probe() enables the PCI device and balances that reference on
probe failure. However, ql3xxx_remove() releases the mappings and PCI
regions without disabling the device, leaving the enable reference
held after unbind.

Add pci_disable_device() at the end of ql3xxx_remove() to balance the
successful probe's pci_enable_device() call. Keep the existing manual
cleanup and probe error handling unchanged.

[...]
Here is the summary with links:
  - [net,v2] net/qla3xxx: disable the PCI device on remove
    https://git.kernel.org/netdev/net-next/c/d328b5ad4a52

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help