Skip to content

Commit 9164e09

Browse files
joehattorirafaeljw
authored andcommitted
thermal: of: fix OF node leak in of_thermal_zone_find()
of_thermal_zone_find() calls of_parse_phandle_with_args(), but does not release the OF node reference obtained by it. Add a of_node_put() call when the call is successful. Fixes: 3fd6d6e ("thermal/of: Rework the thermal device tree initialization") Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp> Link: https://patch.msgid.link/20241224031809.950461-1-joe@pf.is.s.u-tokyo.ac.jp [ rjw: Changelog edit ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 9d89551 commit 9164e09

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/thermal/thermal_of.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int
160160
return ERR_PTR(ret);
161161
}
162162

163+
of_node_put(sensor_specs.np);
163164
if ((sensor == sensor_specs.np) && id == (sensor_specs.args_count ?
164165
sensor_specs.args[0] : 0)) {
165166
pr_debug("sensor %pOFn id=%d belongs to %pOFn\n", sensor, id, child);

0 commit comments

Comments
 (0)