[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6a964031-4286-4898-8c25-c0940a78f387@sirena.org.uk>
Date: Thu, 4 Dec 2025 17:52:54 +0000
From: Mark Brown <broonie@...nel.org>
To: Diederik de Haas <diederik@...ow-tech.com>
Cc: Haotian Zhang <vulab@...as.ac.cn>, Liam Girdwood <lgirdwood@...il.com>,
linux-kernel@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>, linux-pci@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org,
Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH] regulator: fixed: fix GPIO descriptor leak on register
failure
On Thu, Dec 04, 2025 at 12:59:53PM +0100, Diederik de Haas wrote:
> On Tue Oct 28, 2025 at 6:28 PM CET, Haotian Zhang wrote:
> > In the commit referenced by the Fixes tag,
> > devm_gpiod_get_optional() was replaced by manual
> > GPIO management, relying on the regulator core to release the
> > GPIO descriptor. However, this approach does not account for the
> > error path: when regulator registration fails, the core never
> > takes over the GPIO, resulting in a resource leak.
This should just be reverted, the core always takes ownership of and
consumes the GPIO even if it fails (that is simpler than callers working
out how far it got). I've written a patch, I'll send it out later all
being well - thanks for reporting.
> But booting the latest 'bisect kernel', thus based on this commit:
> 636f4618b1cd ("regulator: fixed: fix GPIO descriptor leak on register failure")
> gave a different call trace and landed me in the initramfs:
It's corrupting data structures in gpiolib which will I expect be why
you're seeing varying symptoms - exactly what gets corrupted and how the
data gets looked at afterwards will vary.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists