All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
	Linus Walleij <linus.walleij@linaro.org>,
	Khouloud Touil <ktouil@baylibre.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-gpio <linux-gpio@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 1/4] nvmem: fix memory leak in error path
Date: Thu, 20 Feb 2020 13:45:09 +0100	[thread overview]
Message-ID: <CAMpxmJXiK+A1AF35OJoKnyYYkJ4VZUgqhzzYOazt-UWaMbCfww@mail.gmail.com> (raw)
In-Reply-To: <965f715c-a714-00df-b496-a586969dd086@linaro.org>

czw., 20 lut 2020 o 12:30 Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> napisał(a):
>
>
>
> On 20/02/2020 10:01, Bartosz Golaszewski wrote:
> > -     if (IS_ERR(nvmem->wp_gpio))
> > +     if (IS_ERR(nvmem->wp_gpio)) {
> > +             ida_simple_remove(&nvmem_ida, nvmem->id);
> > +             kfree(nvmem);
> >               return ERR_CAST(nvmem->wp_gpio);
> You freed nvmem just before this statement, how can nvmem->wp_gpio be
> still be valid?
>
> Are you able to test this changes at your end?
> Or
> these are just compile tested?
>

Sorry this was rushed, I will have access to the HW for testing tomorrow.

Bartosz

  reply	other threads:[~2020-02-20 12:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20 10:01 [PATCH v4 0/4] nvmem/gpio: fix resource management Bartosz Golaszewski
2020-02-20 10:01 ` [PATCH v4 1/4] nvmem: fix memory leak in error path Bartosz Golaszewski
2020-02-20 11:30   ` Srinivas Kandagatla
2020-02-20 12:45     ` Bartosz Golaszewski [this message]
2020-02-20 10:01 ` [PATCH v4 2/4] gpiolib: use kref in gpio_desc Bartosz Golaszewski
2020-02-20 12:05   ` Srinivas Kandagatla
2020-02-20 12:51     ` Bartosz Golaszewski
2020-02-20 10:01 ` [PATCH v4 3/4] nvmem: increase the reference count of a gpio passed over config Bartosz Golaszewski
2020-02-22 11:54   ` kbuild test robot
2020-02-22 11:54     ` kbuild test robot
2020-02-23 20:22     ` Bartosz Golaszewski
2020-02-23 20:22       ` Bartosz Golaszewski
2020-02-20 10:01 ` [PATCH v4 4/4] nvmem: release the write-protect pin Bartosz Golaszewski

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=CAMpxmJXiK+A1AF35OJoKnyYYkJ4VZUgqhzzYOazt-UWaMbCfww@mail.gmail.com \
    --to=bgolaszewski@baylibre.com \
    --cc=brgl@bgdev.pl \
    --cc=geert@linux-m68k.org \
    --cc=ktouil@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.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 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.