Files
linux-stable-mirror/drivers/hwmon
Haotian Zhang 0927f7b4dc hwmon: sy7636a: Fix regulator_enable resource leak on error path
[ Upstream commit 2f88425ef5 ]

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: de34a40532 ("hwmon: sy7636a: Add temperature driver for sy7636a")
Suggested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Link: https://lore.kernel.org/r/20251126162602.2086-1-vulab@iscas.ac.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-12-18 13:55:09 +01:00
..
2025-06-27 11:11:42 +01:00
2024-08-27 08:12:23 -07:00
2025-10-29 14:08:59 +01:00