diff mbox series

bus: qcom-ebi2: add missing of_node_put

Message ID 20210216113053.1722-1-angkery@163.com
State New
Headers show
Series bus: qcom-ebi2: add missing of_node_put | expand

Commit Message

Junlin Yang Feb. 16, 2021, 11:30 a.m. UTC
From: Junlin Yang <yangjunlin@yulong.com>

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

Signed-off-by: Junlin Yang <yangjunlin@yulong.com>
---
 drivers/bus/qcom-ebi2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

patchwork-bot+linux-arm-msm@kernel.org March 11, 2021, 7:40 p.m. UTC | #1
Hello:

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

On Tue, 16 Feb 2021 19:30:53 +0800 you wrote:
> From: Junlin Yang <yangjunlin@yulong.com>

> 

> 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
diff mbox series

Patch

diff --git a/drivers/bus/qcom-ebi2.c b/drivers/bus/qcom-ebi2.c
index 03ddcf4..0b8f53a 100644
--- a/drivers/bus/qcom-ebi2.c
+++ b/drivers/bus/qcom-ebi2.c
@@ -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,