Skip to contentSkip to conversation

bus: qcom-ebi2: add missing of_node_put

PATCH Applied angkery 2 participants 2 messages Feb 16, 2021 – Mar 11, 2021

Subsystems (2)
lore
Share & tools
lore

angkery

author
#0 lore raw

PATCH 1/1 bus: qcom-ebi2: add missing of_node_put

From: Junlin Yang <[email protected]>

Fix OF node leaks by calling of_node_put in for_each_available_child_of_node when the cycle returns.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

---
 drivers/bus/qcom-ebi2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/bus/qcom-ebi2.c +3 -1
index 03ddcf4..0b8f53a 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
1.9.1
#1 lore raw
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 Tue, 16 Feb 2021 19:30:53 +0800 you wrote:

From: Junlin Yang <[email protected]>

Fix OF node leaks by calling of_node_put in for_each_available_child_of_node when the cycle returns.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

[...]

Here is the summary with links:
- bus: qcom-ebi2: add missing of_node_put

    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