* [PATCH] net: tlan: disable PCI device on remove
@ 2026-09-16 6:10 Guangshuo Li
2026-09-18 11:06 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: Guangshuo Li @ 2026-09-16 6:10 UTC (permalink / raw)
To: Samuel Chessman, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, netdev, linux-kernel
Cc: Guangshuo Li, stable
tlan_probe1() enables the PCI device with pci_enable_device().
The probe failure path disables the device with pci_disable_device().
However, after a successful probe, tlan_remove_one() releases the PCI
regions and frees the net device without disabling the PCI device.
Call pci_disable_device() during removal to balance the successful
pci_enable_device() call.
This issue was found by manual code inspection.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
drivers/net/ethernet/ti/tlan.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c
index 274a1837025c..0a8bed6c9ca0 100644
--- a/drivers/net/ethernet/ti/tlan.c
+++ b/drivers/net/ethernet/ti/tlan.c
@@ -302,6 +302,9 @@ static void tlan_remove_one(struct pci_dev *pdev)
cancel_work_sync(&priv->tlan_tqueue);
free_netdev(dev);
+#ifdef CONFIG_PCI
+ pci_disable_device(pdev);
+#endif
}
static void tlan_start(struct net_device *dev)
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net: tlan: disable PCI device on remove
2026-09-16 6:10 [PATCH] net: tlan: disable PCI device on remove Guangshuo Li
@ 2026-09-18 11:06 ` Simon Horman
0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2026-09-18 11:06 UTC (permalink / raw)
To: Guangshuo Li
Cc: Samuel Chessman, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, netdev, linux-kernel, stable
On Wed, Sep 16, 2026 at 02:10:56PM +0800, Guangshuo Li wrote:
> tlan_probe1() enables the PCI device with pci_enable_device().
>
> The probe failure path disables the device with pci_disable_device().
> However, after a successful probe, tlan_remove_one() releases the PCI
> regions and frees the net device without disabling the PCI device.
>
> Call pci_disable_device() during removal to balance the successful
> pci_enable_device() call.
>
> This issue was found by manual code inspection.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@vger.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> ---
> drivers/net/ethernet/ti/tlan.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c
> index 274a1837025c..0a8bed6c9ca0 100644
> --- a/drivers/net/ethernet/ti/tlan.c
> +++ b/drivers/net/ethernet/ti/tlan.c
> @@ -302,6 +302,9 @@ static void tlan_remove_one(struct pci_dev *pdev)
>
> cancel_work_sync(&priv->tlan_tqueue);
> free_netdev(dev);
> +#ifdef CONFIG_PCI
> + pci_disable_device(pdev);
> +#endif
I don't think that you need the #ifdef and #endif lines
as I believe that there is a noop implementation
of pci_disable_device when CONFIG_PCI is not set.
Sashiko seems to think so too:
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260916061056.2917164-1-lgs201920130244%40gmail.com
--
pw-bot: changes-requested
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-18 11:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 6:10 [PATCH] net: tlan: disable PCI device on remove Guangshuo Li
2026-09-18 11:06 ` Simon Horman
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®