All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: sm750fb: fix resource leaks on probe error
@ 2026-10-03 17:50 Tymofiy Zakharchuk
  2026-10-13 13:39 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Tymofiy Zakharchuk @ 2026-10-03 17:50 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Ahmet Sezgin Duran,
	Tymofiy Zakharchuk

If sm750fb_framebuffer_alloc() fails during lynxfb_pci_probe(), only
the framebuffer structures are released. The write-combining MTRR,
the MMIO and VRAM mappings, and PCI region 1 remain allocated.

Call arch_phys_wc_del(), iounmap(), and pci_release_region() on the
release_fb error exit path to prevent leaking resources.

Signed-off-by: Tymofiy Zakharchuk <timofey.zakharchuk.research@gmail.com>
---
v2:
 - Fix From and Signed-off-by email mismatch.

 drivers/staging/sm750fb/sm750.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 8b93bfeb2..456b3da86 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1023,6 +1023,10 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
 
 release_fb:
 	sm750fb_framebuffer_release(sm750_dev);
+	arch_phys_wc_del(sm750_dev->mtrr.vram);
+	iounmap(sm750_dev->vmem);
+	iounmap(sm750_dev->mmio);
+	pci_release_region(pdev, 1);
 	return err;
 }
 
-- 
2.53.0.windows.1


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

* Re: [PATCH v2] staging: sm750fb: fix resource leaks on probe error
  2026-10-03 17:50 [PATCH v2] staging: sm750fb: fix resource leaks on probe error Tymofiy Zakharchuk
@ 2026-10-13 13:39 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-10-13 13:39 UTC (permalink / raw)
  To: Tymofiy Zakharchuk; +Cc: linux-staging, linux-kernel, Ahmet Sezgin Duran

On Sat, Oct 03, 2026 at 08:50:55PM +0300, Tymofiy Zakharchuk wrote:
> If sm750fb_framebuffer_alloc() fails during lynxfb_pci_probe(), only
> the framebuffer structures are released. The write-combining MTRR,
> the MMIO and VRAM mappings, and PCI region 1 remain allocated.
> 
> Call arch_phys_wc_del(), iounmap(), and pci_release_region() on the
> release_fb error exit path to prevent leaking resources.
> 
> Signed-off-by: Tymofiy Zakharchuk <timofey.zakharchuk.research@gmail.com>
> ---
> v2:
>  - Fix From and Signed-off-by email mismatch.
> 
>  drivers/staging/sm750fb/sm750.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 8b93bfeb2..456b3da86 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -1023,6 +1023,10 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
>  
>  release_fb:
>  	sm750fb_framebuffer_release(sm750_dev);
> +	arch_phys_wc_del(sm750_dev->mtrr.vram);
> +	iounmap(sm750_dev->vmem);
> +	iounmap(sm750_dev->mmio);
> +	pci_release_region(pdev, 1);
>  	return err;
>  }
>  
> -- 
> 2.53.0.windows.1
> 
> 

How was this found and tested?

thanks,

greg k-h

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

end of thread, other threads:[~2026-10-13 13:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-03 17:50 [PATCH v2] staging: sm750fb: fix resource leaks on probe error Tymofiy Zakharchuk
2026-10-13 13:39 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.