Skip to contentSkip to conversation

cpuidle: Fix reference count on CPU node

PATCH In review Miquel Sabaté Solà 2 participants 6 messages Sep 17, 2024 – Dec 3, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpuidle: Fix reference count on CPU node

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

---
 drivers/cpuidle/cpuidle-qcom-spm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/cpuidle/cpuidle-qcom-spm.c +3 -1
index 1fc9968eae19..d3608f47d02b 100644
@@ -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);
Signature · 1 line
2.46.0
#1 lore raw
Quoted 14 lines · Miquel Sabaté Solà

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

---
 drivers/cpuidle/cpuidle-qcom-spm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/cpuidle/cpuidle-qcom-spm.c +0 -0
index 1fc9968eae19..d3608f47d02b 100644
@@ -96,8 +96,10 @@ static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu)
 		return -ENODEV;

drivers/cpuidle/cpuidle-qcom-spm.c static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu) · line 105

Quoted 10 lines
drivers/cpuidle/cpuidle-qcom-spm.c +3 -1
 
 	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);

Gently ping for a fix in the same spirit as [1].

Could you take a look whenever you have some time?

Thanks!
Miquel

[1] https://lore.kernel.org/all/[email protected]/

#2 lore raw
Quoted 29 lines · Miquel Sabaté Solà
Quoted 14 lines · Miquel Sabaté Solà

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

---
 drivers/cpuidle/cpuidle-qcom-spm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/cpuidle/cpuidle-qcom-spm.c +0 -0
index 1fc9968eae19..d3608f47d02b 100644
@@ -96,8 +96,10 @@ static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu)
 		return -ENODEV;

drivers/cpuidle/cpuidle-qcom-spm.c static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu) · line 105

Quoted 10 lines
drivers/cpuidle/cpuidle-qcom-spm.c +3 -1
 
 	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);

Gently ping for a fix in the same spirit as [1].

Quoted 6 lines

Could you take a look whenever you have some time?

Thanks!
Miquel

[1] https://lore.kernel.org/all/[email protected]/

Gently ping. Could someone take a look at this fix?

Thanks,
Miquel

#3 lore raw
Quoted 36 lines · Miquel Sabaté Solà
Quoted 34 lines · Miquel Sabaté Solà
Quoted 14 lines · Miquel Sabaté Solà

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

---
 drivers/cpuidle/cpuidle-qcom-spm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/cpuidle/cpuidle-qcom-spm.c +0 -0
index 1fc9968eae19..d3608f47d02b 100644
@@ -96,8 +96,10 @@ static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu)
 		return -ENODEV;

drivers/cpuidle/cpuidle-qcom-spm.c static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu) · line 105

Quoted 10 lines
drivers/cpuidle/cpuidle-qcom-spm.c +3 -1
 
 	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);

Gently ping for a fix in the same spirit as [1].

Could you take a look whenever you have some time?

Thanks!
Miquel

Quoted 6 lines
Quoted 1 line

[1] https://lore.kernel.org/all/[email protected]/

Gently ping. Could someone take a look at this fix?

Thanks,
Miquel

Hello,

This is most probably too late for 6.12, but might this be included for 6.13?

Could you take a look?

Thanks,
Miquel

#4 lore raw
Quoted 47 lines · Miquel Sabaté Solà
Quoted 36 lines · Miquel Sabaté Solà
Quoted 34 lines · Miquel Sabaté Solà
Quoted 14 lines · Miquel Sabaté Solà

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

---
 drivers/cpuidle/cpuidle-qcom-spm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/cpuidle/cpuidle-qcom-spm.c +0 -0
index 1fc9968eae19..d3608f47d02b 100644
@@ -96,8 +96,10 @@ static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu)
 		return -ENODEV;

drivers/cpuidle/cpuidle-qcom-spm.c static int spm_cpuidle_register(struct device *cpuidle_dev, int cpu) · line 105

Quoted 10 lines
drivers/cpuidle/cpuidle-qcom-spm.c +3 -1
 
 	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);

Gently ping for a fix in the same spirit as [1].

Could you take a look whenever you have some time?

Thanks!
Miquel

Quoted 6 lines
Quoted 1 line

[1] https://lore.kernel.org/all/[email protected]/

Gently ping. Could someone take a look at this fix?

Thanks,
Miquel

Hello,

Quoted 7 lines

This is most probably too late for 6.12, but might this be included for 6.13?

Could you take a look?

Thanks,
Miquel

Hello,

Gently ping. Could you please take a look at this fix?

Thanks,
Miquel

Reviewed-by on v1 1/1
#5 lore raw
In reply to Miquel Sabaté Solà
Quoted 8 lines · Miquel Sabaté Solà

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

---
 drivers/cpuidle/cpuidle-qcom-spm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 2 lines
With best wishes
Dmitry