mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tymofiy Zakharchuk <timofey.zakharchuk.research@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Ahmet Sezgin Duran <ahmet@sezginduran.net>
Subject: Re: [PATCH v2] staging: sm750fb: fix resource leaks on probe error
Date: Tue, 13 Oct 2026 15:39:33 +0200	[thread overview]
Message-ID: <2026101326-pectin-decent-7407@gregkh> (raw)
In-Reply-To: <20261003175055.1511-1-timofey.zakharchuk.research@gmail.com>

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

      reply	other threads:[~2026-10-13 13:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-03 17:50 Tymofiy Zakharchuk
2026-10-13 13:39 ` Greg KH [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=2026101326-pectin-decent-7407@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=ahmet@sezginduran.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=timofey.zakharchuk.research@gmail.com \
    /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®