Re: [PATCH] ASoC: cs4271: Fix regulator leak on probe failure

From: Charles Keepax

Date: Thu Nov 06 2025 - 06:03:53 EST


On Wed, Nov 05, 2025 at 02:22:46PM +0800, Haotian Zhang wrote:
> The probe function enables regulators at the beginning
> but fails to disable them in its error handling path.
> If any operation after enabling the regulators fails,
> the probe will exit with an error, leaving the regulators
> permanently enabled, which could lead to a resource leak.
>
> Add a proper error handling path to call regulator_bulk_disable()
> before returning an error.
>
> Fixes: 9a397f473657 ("ASoC: cs4271: add regulator consumer support")
> Signed-off-by: Haotian Zhang <vulab@xxxxxxxxxxx>
> ---

Reviewed-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>

Thanks,
Charles