Patch "thermal: of: fix OF node leak in of_thermal_zone_find()" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    thermal: of: fix OF node leak in of_thermal_zone_find()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     thermal-of-fix-of-node-leak-in-of_thermal_zone_find.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d5e8c341e5aa80e1525c25316ab1e40461757be9
Author: Joe Hattori <joe@xxxxxxxxxxxxxxxxxxxxx>
Date:   Tue Dec 24 12:18:09 2024 +0900

    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@xxxxxxxxxxxxxxxxxxxxx>
    Link: https://patch.msgid.link/20241224031809.950461-1-joe@xxxxxxxxxxxxxxxxxxxxx
    [ rjw: Changelog edit ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index 07476147559a..95939df314d1 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -315,6 +315,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);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux