linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jianglei Nie <niejianglei2021@163.com>
Cc: ojeda@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] auxdisplay: hd44780: Fix potential memory leak in hd44780_remove()
Date: Thu, 24 Nov 2022 21:19:19 +0200	[thread overview]
Message-ID: <Y3/Dt3f4edPqPFqb@smile.fi.intel.com> (raw)
In-Reply-To: <20220907070735.56488-1-niejianglei2021@163.com>

On Wed, Sep 07, 2022 at 03:07:35PM +0800, Jianglei Nie wrote:
> hd44780_probe() allocates a memory chunk for hd with kzalloc() and
> makes "lcd->drvdata->hd44780" point to it. When we call hd44780_remove(),
> we should release all relevant memory and resource. But "lcd->drvdata
> ->hd44780" is not released, which will lead to a memory leak.
> 
> We should release the "lcd->drvdata->hd44780" in hd44780_remove() to fix
> the memory leak bug.

It's pity you haven't compiled your stuff, while the analysis seems valid
to me.

What you need to do is:
1) compile on your side _before_ sending and be sure it compiles;
2) in this particular case you need an additional level of typing;
3) add Fixes tag;
4) resubmit as v2 the new version.

-- 
With Best Regards,
Andy Shevchenko



  parent reply	other threads:[~2022-11-24 19:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-07  7:07 [PATCH] auxdisplay: hd44780: Fix potential memory leak in hd44780_remove() Jianglei Nie
2022-09-07  9:36 ` kernel test robot
2022-09-07  9:56 ` kernel test robot
2022-09-07 10:17 ` kernel test robot
2022-11-24 19:19 ` Andy Shevchenko [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-07-04  1:27 Jianglei Nie

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=Y3/Dt3f4edPqPFqb@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=niejianglei2021@163.com \
    --cc=ojeda@kernel.org \
    /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 NNTP newsgroup(s).