Patch "soc: qcom: aoss: Fix refcount leak in qmp_cooling_devices_register" has been added to the 5.10-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

    soc: qcom: aoss: Fix refcount leak in qmp_cooling_devices_register

to the 5.10-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:
     soc-qcom-aoss-fix-refcount-leak-in-qmp_cooling_devic.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 2a0b738cccb8813abae0066d457a900ca5d4b40e
Author: Miaoqian Lin <linmq006@xxxxxxxxx>
Date:   Mon Jun 6 10:42:52 2022 +0400

    soc: qcom: aoss: Fix refcount leak in qmp_cooling_devices_register
    
    [ Upstream commit e6e0951414a314e7db3e9e24fd924b3e15515288 ]
    
    Every iteration of for_each_available_child_of_node() decrements
    the reference count of the previous node.
    When breaking early from a for_each_available_child_of_node() loop,
    we need to explicitly call of_node_put() on the child node.
    Add missing of_node_put() to avoid refcount leak.
    
    Fixes: 05589b30b21a ("soc: qcom: Extend AOSS QMP driver to support resources that are used to wake up the SoC.")
    Signed-off-by: Miaoqian Lin <linmq006@xxxxxxxxx>
    Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220606064252.42595-1-linmq006@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c
index 941499b11758..401a0be3675a 100644
--- a/drivers/soc/qcom/qcom_aoss.c
+++ b/drivers/soc/qcom/qcom_aoss.c
@@ -493,8 +493,10 @@ static int qmp_cooling_devices_register(struct qmp *qmp)
 			continue;
 		ret = qmp_cooling_device_add(qmp, &qmp->cooling_devs[count++],
 					     child);
-		if (ret)
+		if (ret) {
+			of_node_put(child);
 			goto unroll;
+		}
 	}
 
 	if (!count)



[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