Skip to contentSkip to conversation

bus: qcom: ebi2: fix device node iterator leak

PATCH Applied Tobias Jordan 3 participants 3 messages Sep 25, 2020 – Mar 11, 2021

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

PATCH 1/1 bus: qcom: ebi2: fix device node iterator leak

In the for_each_available_child_of_node loop of qcom_ebi2_probe, add a call to of_node_put to avoid leaking the iterator if we bail out.

Fixes 335a12754808 ("bus: qcom: add EBI2 driver")
---
 drivers/bus/qcom-ebi2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/bus/qcom-ebi2.c +3 -1
index 03ddcf426887..0b8f53a688b8 100644
@@ -353,8 +353,10 @@ static int qcom_ebi2_probe(struct platform_device *pdev)
 
 		/* Figure out the chipselect */
 		ret = of_property_read_u32(child, "reg", &csindex);
-		if (ret)
+		if (ret) {
+			of_node_put(child);
 			return ret;
+		}
 
 		if (csindex > 5) {
 			dev_err(dev,
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Tobias Jordan

In the for_each_available_child_of_node loop of qcom_ebi2_probe, add a call to of_node_put to avoid leaking the iterator if we bail out.

Fixes 335a12754808 ("bus: qcom: add EBI2 driver")

Bjorn can you apply this to the Qualcomm SoC tree?

Yours,
Linus Walleij

#2 lore raw
In reply to Tobias Jordan
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 8 lines · On Sat, 26 Sep 2020 01:45:04 +0200 you wrote:

In the for_each_available_child_of_node loop of qcom_ebi2_probe, add a call to of_node_put to avoid leaking the iterator if we bail out.

Fixes 335a12754808 ("bus: qcom: add EBI2 driver")

[...]

Here is the summary with links:
- bus: qcom: ebi2: fix device node iterator leak

    https://git.kernel.org/qcom/c/4f26f0c36fe2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html