Skip to content

Commit 5b80f2f

Browse files
joehattorigregkh
authored andcommitted
thermal: of: fix OF node leak in of_thermal_zone_find()
[ Upstream commit 9164e09 ] 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 <[email protected]> Link: https://patch.msgid.link/[email protected] [ rjw: Changelog edit ] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent dc63fd2 commit 5b80f2f

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
@@ -176,6 +176,7 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int
176176
goto out;
177177
}
178178

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

0 commit comments

Comments
 (0)