mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] serial: icom: Disable the PCI device on final adapter release
@ 2026-09-15  0:59 Myeonghun Pak
  2026-09-23 10:18 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Myeonghun Pak @ 2026-09-15  0:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby; +Cc: linux-serial, linux-kernel, stable

icom_probe() enables the PCI device, but the final adapter release
never disables it. Balance the enable after releasing the IRQ, mapping
and PCI regions, while the adapter's PCI device pointer is still valid.

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/tty/serial/icom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c
--- a/drivers/tty/serial/icom.c
+++ b/drivers/tty/serial/icom.c
@@ -1691,6 +1691,7 @@ static void icom_kref_release(struct kref *kref)
 	free_irq(icom_adapter->pci_dev->irq, (void *) icom_adapter);
 	iounmap(icom_adapter->base_addr);
 	pci_release_regions(icom_adapter->pci_dev);
+	pci_disable_device(icom_adapter->pci_dev);
 	icom_free_adapter(icom_adapter);
 }
 

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

* Re: [PATCH] serial: icom: Disable the PCI device on final adapter release
  2026-09-15  0:59 [PATCH] serial: icom: Disable the PCI device on final adapter release Myeonghun Pak
@ 2026-09-23 10:18 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2026-09-23 10:18 UTC (permalink / raw)
  To: Myeonghun Pak; +Cc: Jiri Slaby, linux-serial, linux-kernel, stable

On Mon, Sep 14, 2026 at 08:59:59PM -0400, Myeonghun Pak wrote:
> icom_probe() enables the PCI device, but the final adapter release
> never disables it. Balance the enable after releasing the IRQ, mapping
> and PCI regions, while the adapter's PCI device pointer is still valid.
> 
> 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/tty/serial/icom.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c
> --- a/drivers/tty/serial/icom.c
> +++ b/drivers/tty/serial/icom.c
> @@ -1691,6 +1691,7 @@ static void icom_kref_release(struct kref *kref)
>  	free_irq(icom_adapter->pci_dev->irq, (void *) icom_adapter);
>  	iounmap(icom_adapter->base_addr);
>  	pci_release_regions(icom_adapter->pci_dev);
> +	pci_disable_device(icom_adapter->pci_dev);

Are you sure this is correct?  Lots of time disabling the device is not
what you want to do as it can cause hardware problems.

Have you tested this on the hardware?  If not, I can't take it for
obvious reasons.

thanks,

greg k-h

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

end of thread, other threads:[~2026-09-23 10:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-15  0:59 [PATCH] serial: icom: Disable the PCI device on final adapter release Myeonghun Pak
2026-09-23 10:18 ` Greg Kroah-Hartman

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®