Re: [PATCH] regulator: arizona-ldo1: Fix double gpiod_put() on enable GPIO
From: Charles Keepax
Date: Thu Nov 05 2026 - 05:03:56 EST
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@xxxxxxxxx>
> ---
Reviewed-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
Thanks,
Charles