Skip to contentSkip to conversation

drm/sprd: fix for_each_child.cocci warnings

PATCH New Julia Lawall 1 participant 1 message Apr 27, 2021

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

PATCH 1/1 drm/sprd: fix for_each_child.cocci warnings

From: kernel test robot <[email protected]>

for_each_child_of_node should have of_node_put() before return.

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

---

url:    https://github.com/0day-ci/linux/commits/Kevin-Tang/Add-Unisoc-s-drm-kms-module/20210425-203751
base:    e3d35712f85ac84fb06234848f6c043ab418cf8b

:::::: branch date: 2 days ago
:::::: commit date: 2 days ago

Please take the patch only if it's a positive warning. Thanks!

 sprd_dsi.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/sprd/sprd_dsi.c +2 -0
@@ -788,6 +788,7 @@ static int sprd_dsi_find_panel(struct sp
 		panel = of_drm_find_panel(child);
 		if (!IS_ERR(panel)) {
 			dsi->panel = panel;
+			of_node_put(child);
 			return 0;
 		}
 	}
@@ -800,6 +801,7 @@ static int sprd_dsi_find_panel(struct sp
 		panel = of_drm_find_panel(child);
 		if (!IS_ERR(panel)) {
 			dsi->panel = panel;
+			of_node_put(child);
 			return 0;
 		}
 	}