From: Chenguang Zhao <chenguang.zhao@linux.dev>
To: Myeonghun Pak <mhun512@gmail.com>
Cc: Denis Kirjanov <kirjanov@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH net] net: sundance: balance PCI enable on cleanup
Date: Tue, 15 Sep 2026 09:58:02 +0800 [thread overview]
Message-ID: <20260915015802.GA95173@pc> (raw)
In-Reply-To: <20260915010849.54718-1-mhun512@gmail.com>
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
prev parent reply other threads:[~2026-09-15 1:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 1:08 Myeonghun Pak
2026-09-15 1:58 ` Chenguang Zhao [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260915015802.GA95173@pc \
--to=chenguang.zhao@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kirjanov@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhun512@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®