Re: [PATCH v2] hwmon: sy7636a: Fix regulator_enable resource leak on error path

From: Guenter Roeck

Date: Wed Nov 26 2025 - 12:03:40 EST


On Thu, Nov 27, 2025 at 12:26:02AM +0800, Haotian Zhang wrote:
> In sy7636a_sensor_probe(), regulator_enable() is called but if
> devm_hwmon_device_register_with_info() fails, the function returns
> without calling regulator_disable(), leaving the regulator enabled
> and leaking the reference count.
>
> Switch to devm_regulator_get_enable() to automatically
> manage the regulator resource.
>
> Fixes: de34a4053250 ("hwmon: sy7636a: Add temperature driver for sy7636a")
> Suggested-by: Guenter Roeck <linux@xxxxxxxxxxxx>
> Signed-off-by: Haotian Zhang <vulab@xxxxxxxxxxx>

Applied.

Thanks,
Guenter