Linux-fbdev Archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jianglei Nie <niejianglei2021@163.com>
Cc: gregkh@linuxfoundation.org, tzimmermann@suse.de,
	javierm@redhat.com, sam@ravnborg.org, steve@sk2.org,
	noralf@tronnes.org, u.kleine-koenig@pengutronix.de,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: fbtft: core: fix potential memory leak in fbtft_probe_common()
Date: Thu, 4 Apr 2024 19:35:12 +0300	[thread overview]
Message-ID: <Zg7WwNEpZlYsvNwJ@smile.fi.intel.com> (raw)
In-Reply-To: <20220928062301.6399-1-niejianglei2021@163.com>

On Wed, Sep 28, 2022 at 02:23:01PM +0800, Jianglei Nie wrote:
> fbtft_probe_common() allocates a memory chunk for "info" with
> fbtft_framebuffer_alloc(). When "display->buswidth == 0" is true, the
> function returns without releasing the "info", which will lead to a
> memory leak.
> 
> Fix it by calling fbtft_framebuffer_release() when "display->buswidth
> == 0" is true.

Fixes tag?

...

>  	if (display->buswidth == 0) {
>  		dev_err(dev, "buswidth is not set\n");
> +		fbtft_framebuffer_release(info);
>  		return -EINVAL;

		ret = dev_err_probe(dev, -EINVAL, "buswidth is not set\n");
		goto out_release;

>  	}

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2024-04-04 16:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28  6:23 [PATCH] staging: fbtft: core: fix potential memory leak in fbtft_probe_common() Jianglei Nie
2024-04-04 16:35 ` Andy Shevchenko [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=Zg7WwNEpZlYsvNwJ@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=javierm@redhat.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=niejianglei2021@163.com \
    --cc=noralf@tronnes.org \
    --cc=sam@ravnborg.org \
    --cc=steve@sk2.org \
    --cc=tzimmermann@suse.de \
    --cc=u.kleine-koenig@pengutronix.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).