mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
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: 12d821bd13 ("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>
This commit is contained in:
parent
4b73231b2a
commit
0902010c8d
1 changed files with 3 additions and 4 deletions
|
|
@ -144,13 +144,12 @@ static int fp9931_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
|
|||
return ret;
|
||||
|
||||
ret = regmap_read(data->regmap, FP9931_REG_TMST_VALUE, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (!ret)
|
||||
*temp = (s8)val * 1000;
|
||||
|
||||
pm_runtime_put_autosuspend(data->dev);
|
||||
*temp = (s8)val * 1000;
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static umode_t fp9931_hwmon_is_visible(const void *data,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue