Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

regulator: fp9931: Fix PM runtime reference leak in fp9931_hwmon_read()

In fp9931_hwmon_read(), if regmap_read() failed, the function returned
the error code without calling pm_runtime_put_autosuspend(), causing
a PM reference leak.

Fixes: 12d821bd13d4 ("regulator: Add FP9931/JD9930 driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20260224-fp9931-v1-1-1cf05cabef4a@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Felix Gu and committed by
Mark Brown
0902010c 4b73231b

+3 -4
+3 -4
drivers/regulator/fp9931.c
··· 144 144 return ret; 145 145 146 146 ret = regmap_read(data->regmap, FP9931_REG_TMST_VALUE, &val); 147 - if (ret) 148 - return ret; 147 + if (!ret) 148 + *temp = (s8)val * 1000; 149 149 150 150 pm_runtime_put_autosuspend(data->dev); 151 - *temp = (s8)val * 1000; 152 151 153 - return 0; 152 + return ret; 154 153 } 155 154 156 155 static umode_t fp9931_hwmon_is_visible(const void *data,