]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
thermal: of: fix OF node leak in of_thermal_zone_find()
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Tue, 24 Dec 2024 03:18:09 +0000 (12:18 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2025 12:34:42 +0000 (13:34 +0100)
commitd0645e11141b4ca2ad15377712794138f574502e
tree22258be63fa142c909bb306ecd341721ff880ee0
parentf3d1e4062ef251fa55ccfeca1e54a98b6818b3a1
thermal: of: fix OF node leak in of_thermal_zone_find()

[ Upstream commit 9164e0912af206a72ddac4915f7784e470a04ace ]

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: 3fd6d6e2b4e8 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/thermal_of.c