linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: liu xiang <liu.xiang@zlingsmart.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@siol.net>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	liuxiang_1999 <liuxiang_1999@126.com>
Subject: Re: [PATCH] pinctrl: sunxi: fix use-after-free in sunxi_pmx_free()
Date: Tue, 26 Jan 2021 16:24:26 +0100	[thread overview]
Message-ID: <20210126152426.pmnuipcyaloaz4tx@gilmour> (raw)
In-Reply-To: <CACRpkdaJQcuWwS2g4UgRpWb+iHYSmWoNj6gEsvGwtPZq+aJBbQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]

On Tue, Jan 26, 2021 at 04:03:29PM +0100, Linus Walleij wrote:
> On Tue, Jan 26, 2021 at 7:31 AM liu xiang <liu.xiang@zlingsmart.com> wrote:
> 
> > > Liu can you make a patch to Kconfig to just select REGULATOR?
> > > Possibly even the specific regulator driver this SoC is using
> > > if it is very specific for this purpose.
> >
> > I found that the regulator driver is related to the specific board, not the SoC.
> > There is no board config for ARM64 SoC like ARM.
> > Is a good idea to select the regulator driver in the pinctrl Konfig? Or just
> > select CONFIG_REGULATOR_FIXED_VOLTAGE to avoid the use-after-free warning?
> 
> If that regulator is what the board uses to satisfy this driver then that
> is what you should select. Write some blurb in the commit message
> about what is going on.
> 
> You can even add a comment in Kconfig like that:
> 
> # Needed to provide power to rails
> select REGULATOR_FIXED_VOLTAGE

Virtually all the boards will need a regulator, but you can't make the
assumption that this is the driver that is going to be used. In most
case, it isn't.

But it's not really a big deal, we depend on the framework itself being
enabled for regulator_get to return the proper error, not one given
driver.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2021-01-26 15:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19  6:29 [PATCH] pinctrl: sunxi: fix use-after-free in sunxi_pmx_free() Liu Xiang
2021-01-21 16:40 ` Maxime Ripard
2021-01-22  6:15   ` liu xiang
2021-01-22 22:53   ` Linus Walleij
2021-01-26  2:32     ` liu xiang
2021-01-26  6:31     ` liu xiang
2021-01-26 15:03       ` Linus Walleij
2021-01-26 15:24         ` Maxime Ripard [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=20210126152426.pmnuipcyaloaz4tx@gilmour \
    --to=maxime@cerno.tech \
    --cc=jernej.skrabec@siol.net \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liu.xiang@zlingsmart.com \
    --cc=liuxiang_1999@126.com \
    --cc=wens@csie.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).