]> git.ipfire.org Git - thirdparty/linux.git/commit
regulator: fixed: Rely on the core freeing the enable GPIO
authorMark Brown <broonie@kernel.org>
Thu, 4 Dec 2025 19:39:34 +0000 (19:39 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 5 Dec 2025 14:23:48 +0000 (14:23 +0000)
commit79a45ddcdbba330f5139c7c7ff7042d69cf147b2
treee5734fe927059b63071e23f5173194ae70496107
parent84c8097e677478b64e10b6e44e3857eb0f02ba68
regulator: fixed: Rely on the core freeing the enable GPIO

In order to simplify ownership rules for enable GPIOs supplied by drivers
regulator_register() always takes ownership of them, even if it ends up
failing for some other reason. We therefore should not free the GPIO if
registration fails but just let the core worry about things.

Fixes: 636f4618b1cd (regulator: fixed: fix GPIO descriptor leak on register failure)
Reported-by: Diederik de Haas <diederik@cknow-tech.com>
Closes: https://lore.kernel.org/r/DEPEYUF5BRGY.UKFBWRRE8HNP@cknow-tech.com
Tested-by: Diederik de Haas <diederik@cknow-tech.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://patch.msgid.link/20251204-regulator-fixed-fix-gpiod-leak-v1-1-48efea5b82c2@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/fixed.c