lkml.org 
[lkml]   [2023]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drivers: bus: Fix resource leaks in for_each_available_child_of_node loop
Date
Ensure child node references are decremented properly in
the error path.

Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
---
drivers/bus/imx-weim.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
index 52a5d0447390..d05472f7c20f 100644
--- a/drivers/bus/imx-weim.c
+++ b/drivers/bus/imx-weim.c
@@ -251,6 +251,7 @@ static int weim_parse_dt(struct platform_device *pdev)
else
have_child = 1;
}
+ of_node_put(child);

if (have_child)
ret = of_platform_default_populate(pdev->dev.of_node,
--
2.39.0
\
 
 \ /
  Last update: 2023-07-06 09:14    [W:0.071 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site