linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Liang He <windhl@126.com>
Cc: brgl@bgdev.pl, linux-gpio@vger.kernel.org
Subject: Re: [PATCH v2] gpio: gpiolib-of: Fix refcount bugs in of_mm_gpiochip_add_data()
Date: Mon, 11 Jul 2022 15:23:15 +0200	[thread overview]
Message-ID: <CACRpkdZJBT86um5VM0e2mnMEv=cVrg7PmZNGbZ0GwxC-1nXbBQ@mail.gmail.com> (raw)
In-Reply-To: <20220711125238.360962-1-windhl@126.com>

On Mon, Jul 11, 2022 at 2:52 PM Liang He <windhl@126.com> wrote:

> We should use of_node_get() when a new reference of device_node
> is created. It is noted that the old reference stored in
> 'mm_gc->gc.of_node' should also be decreased.
>
> This patch is based on the fact that there is a call site in function
> 'qe_add_gpiochips()' of src file 'drivers\soc\fsl\qe\gpio.c'. In this
> function, of_mm_gpiochip_add_data() is contained in an iteration of
> for_each_compatible_node() which will automatically increase and
> decrease the refcount. So we need additional of_node_get() for the
> reference escape in of_mm_gpiochip_add_data().
>
> Fixes: a19e3da5bc5f ("of/gpio: Kill of_gpio_chip and add members directly to gpio_chip")
> Signed-off-by: Liang He <windhl@126.com>

Patch applied for next as nonurgent fix!

Yours,
Linus Walleij

  reply	other threads:[~2022-07-11 13:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-11 12:52 [PATCH v2] gpio: gpiolib-of: Fix refcount bugs in of_mm_gpiochip_add_data() Liang He
2022-07-11 13:23 ` Linus Walleij [this message]
2022-07-12  8:26   ` Linus Walleij
2022-07-12 10:20     ` 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='CACRpkdZJBT86um5VM0e2mnMEv=cVrg7PmZNGbZ0GwxC-1nXbBQ@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=linux-gpio@vger.kernel.org \
    --cc=windhl@126.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;
as well as URLs for NNTP newsgroup(s).