linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Vadym Kochan <vadym.kochan@plvision.eu>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] nvmem: core: fix possibly memleak when use nvmem_cell_info_to_nvmem_cell()
Date: Sun, 27 Sep 2020 14:25:16 +0200	[thread overview]
Message-ID: <20200927122516.GB179084@kroah.com> (raw)
In-Reply-To: <12edae35-a927-11bf-f80a-037011c4f07a@linaro.org>

On Fri, Sep 25, 2020 at 10:32:42AM +0100, Srinivas Kandagatla wrote:
> 
> 
> On 23/09/2020 21:44, Vadym Kochan wrote:
> > Fix missing 'kfree_const(cell->name)' when call to
> > nvmem_cell_info_to_nvmem_cell() in several places:
> > 
> >       * after nvmem_cell_info_to_nvmem_cell() failed during
> >         nvmem_add_cells()
> > 
> >       * during nvmem_device_cell_{read,write} when cell->name is
> >         kstrdup'ed() without calling kfree_const() at the end, but
> >         really there is no reason to do that 'dup, because the cell
> >         instance is allocated on the stack for some short period to be
> >         read/write without exposing it to the caller.
> > 
> > So the new nvmem_cell_info_to_nvmem_cell_nodup() helper is introduced
> > which is used to convert cell_info -> cell without name duplication as
> > a lighweight version of nvmem_cell_info_to_nvmem_cell().
> > 
> > Fixes: e2a5402ec7c6 ("nvmem: Add nvmem_device based consumer apis.")
> > Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>
> 
> Looks good to me! Thanks for the patch.
> 
> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> 
> Greg,
> 
> Can you please pick this one? As don't have any nvmem pending patches to
> send it together.

Will do, thanks.

greg k-h

      reply	other threads:[~2020-09-27 12:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 20:44 [PATCH v3] nvmem: core: fix possibly memleak when use nvmem_cell_info_to_nvmem_cell() Vadym Kochan
2020-09-25  9:32 ` Srinivas Kandagatla
2020-09-27 12:25   ` Greg Kroah-Hartman [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=20200927122516.GB179084@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=vadym.kochan@plvision.eu \
    /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).