]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 6.6
authorSasha Levin <sashal@kernel.org>
Sat, 11 Jan 2025 19:12:11 +0000 (14:12 -0500)
committerSasha Levin <sashal@kernel.org>
Sat, 11 Jan 2025 19:12:11 +0000 (14:12 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-6.6/series
queue-6.6/thermal-of-fix-of-node-leak-in-of_thermal_zone_find.patch [new file with mode: 0644]

index d2c5900d39d85eabe36046b93aa5f1126c6639e3..f2b5b229078097d5b3bc5294d712e7cc209993f9 100644 (file)
@@ -68,3 +68,4 @@ sctp-sysctl-udp_port-avoid-using-current-nsproxy.patch
 sctp-sysctl-plpmtud_probe_interval-avoid-using-current-nsproxy.patch
 ksmbd-implement-new-smb3-posix-type.patch
 drm-amd-display-add-check-for-granularity-in-dml-ceil-floor-helpers.patch
+thermal-of-fix-of-node-leak-in-of_thermal_zone_find.patch
diff --git a/queue-6.6/thermal-of-fix-of-node-leak-in-of_thermal_zone_find.patch b/queue-6.6/thermal-of-fix-of-node-leak-in-of_thermal_zone_find.patch
new file mode 100644 (file)
index 0000000..6233f8e
--- /dev/null
@@ -0,0 +1,39 @@
+From 990e1597464539760d7cfa4db0dfd00093b493da Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 24 Dec 2024 12:18:09 +0900
+Subject: thermal: of: fix OF node leak in of_thermal_zone_find()
+
+From: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
+
+[ 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 | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
+index 4e5f86c21456..0f520cf923a1 100644
+--- a/drivers/thermal/thermal_of.c
++++ b/drivers/thermal/thermal_of.c
+@@ -203,6 +203,7 @@ static struct device_node *of_thermal_zone_find(struct device_node *sensor, int
+                               goto out;
+                       }
++                      of_node_put(sensor_specs.np);
+                       if ((sensor == sensor_specs.np) && id == (sensor_specs.args_count ?
+                                                                 sensor_specs.args[0] : 0)) {
+                               pr_debug("sensor %pOFn id=%d belongs to %pOFn\n", sensor, id, child);
+-- 
+2.39.5
+