[PATCH] cpuidle: Fix reference count on CPU node

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

 



For the qcom-spm driver, an early return was not calling the proper
of_node_put call for a previously acquired device node.

Signed-off-by: Miquel Sabaté Solà <mikisabate@xxxxxxxxx>
---
 drivers/cpuidle/cpuidle-qcom-spm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/cpuidle/cpuidle-qcom-spm.c b/drivers/cpuidle/cpuidle-qcom-spm.c
index 1fc9968eae19..d3608f47d02b 100644
--- a/drivers/cpuidle/cpuidle-qcom-spm.c
+++ b/drivers/cpuidle/cpuidle-qcom-spm.c
@@ -96,8 +96,10 @@ static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu)
 		return -ENODEV;
 
 	saw_node = of_parse_phandle(cpu_node, "qcom,saw", 0);
-	if (!saw_node)
+	if (!saw_node) {
+		of_node_put(cpu_node);
 		return -ENODEV;
+	}
 
 	pdev = of_find_device_by_node(saw_node);
 	of_node_put(saw_node);
-- 
2.46.0





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux