From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
patches@opensource.cirrus.com, linux-kernel@vger.kernel.org,
Linus Walleij <linusw@kernel.org>
Subject: Re: [PATCH] regulator: arizona-ldo1: Fix double gpiod_put() on enable GPIO
Date: Thu, 5 Nov 2026 08:41:49 -0800 [thread overview]
Message-ID: <auyxtliL5Nx-dJw1@google.com> (raw)
In-Reply-To: <auxViNgjGPRdpfa2@opensource.cirrus.com>
On Thu, Nov 05, 2026 at 10:08:08AM +0000, Charles Keepax wrote:
> On Thu, Nov 05, 2026 at 10:02:00AM +0000, Charles Keepax wrote:
> > On Wed, Nov 04, 2026 at 10:38:32PM -0800, Dmitry Torokhov wrote:
> > > When arizona-ldo1 registers the regulator, the regulator core takes
> > > ownership of the GPIO descriptor passed in regulator_config.ena_gpiod.
> > > The core frees this enable GPIO descriptor both on registration error
> > > and when the regulator device is unregistered.
> > >
> > > Because the driver also tracked the descriptor and called gpiod_put()
> > > in its driver remove callback, unbinding the driver causes a duplicate
> > > gpiod_put(). Remove the driver remove callback and stop storing the
> > > enable GPIO descriptor in driver private data to avoid the double
> > > free.
> > >
> > > Fixes: a9191579ba10 ("regulator: arizona-ldo1: Use correct device to get enable GPIO")
> > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > ---
> >
> > Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
>
> Seems Lee has sent an almost identical patch:
>
> https://lore.kernel.org/lkml/20261104182148.1176116-3-lee@kernel.org/
>
> Perhaps we should go with that version as it also removes the
> now redundant platform_set_drvdata.
Sure, fine with me.
--
Dmitry
prev parent reply other threads:[~2026-11-05 16:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 6:38 Dmitry Torokhov
2026-11-05 10:02 ` Charles Keepax
2026-11-05 10:08 ` Charles Keepax
2026-11-05 16:41 ` Dmitry Torokhov [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=auyxtliL5Nx-dJw1@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=lgirdwood@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.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
all inboxes | Powered by JetHome®