mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] net: sundance: balance PCI enable on cleanup
@ 2026-09-15  1:08 Myeonghun Pak
  2026-09-15  1:58 ` Chenguang Zhao
  0 siblings, 1 reply; 2+ messages in thread
From: Myeonghun Pak @ 2026-09-15  1:08 UTC (permalink / raw)
  To: Denis Kirjanov
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel, stable

sundance_probe1() enables the PCI device, but subsequent failure paths
and sundance_remove1() never release the enable reference.

Use pcim_enable_device() to disable the device after existing network,
DMA, mapping and region cleanup on probe failure or driver detach.

The imbalance is already present in the initial Git import.

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

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
 drivers/net/ethernet/dlink/sundance.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/dlink/sundance.c b/drivers/net/ethernet/dlink/sundance.c
--- a/drivers/net/ethernet/dlink/sundance.c
+++ b/drivers/net/ethernet/dlink/sundance.c
@@ -510,7 +510,7 @@
 	int phy, phy_end, phy_idx = 0;
 	__le16 addr[ETH_ALEN / 2];
 
-	if (pci_enable_device(pdev))
+	if (pcim_enable_device(pdev))
 		return -EIO;
 	pci_set_master(pdev);
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: sundance: balance PCI enable on cleanup
  2026-09-15  1:08 [PATCH net] net: sundance: balance PCI enable on cleanup Myeonghun Pak
@ 2026-09-15  1:58 ` Chenguang Zhao
  0 siblings, 0 replies; 2+ messages in thread
From: Chenguang Zhao @ 2026-09-15  1:58 UTC (permalink / raw)
  To: Myeonghun Pak
  Cc: Denis Kirjanov, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel, stable

On Mon, Sep 14, 2026 at 09:08:49PM -0400, Myeonghun Pak wrote:
> sundance_probe1() enables the PCI device, but subsequent failure paths
> and sundance_remove1() never release the enable reference.
> 
> Use pcim_enable_device() to disable the device after existing network,
> DMA, mapping and region cleanup on probe failure or driver detach.
> 
> The imbalance is already present in the initial Git import.
> 
> This issue was identified during our ongoing static-analysis research
> while reviewing kernel code.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Co-developed-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
> ---
>  drivers/net/ethernet/dlink/sundance.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/dlink/sundance.c b/drivers/net/ethernet/dlink/sundance.c
> --- a/drivers/net/ethernet/dlink/sundance.c
> +++ b/drivers/net/ethernet/dlink/sundance.c
> @@ -510,7 +510,7 @@
>  	int phy, phy_end, phy_idx = 0;
>  	__le16 addr[ETH_ALEN / 2];
>  
> -	if (pci_enable_device(pdev))
> +	if (pcim_enable_device(pdev))
>  		return -EIO;
>  	pci_set_master(pdev);
>  

Reviewed-by: Chenguang Zhao <zhaochenguang@kylinos.cn>

Thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-15  1:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-15  1:08 [PATCH net] net: sundance: balance PCI enable on cleanup Myeonghun Pak
2026-09-15  1:58 ` Chenguang Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®