CC: kbuild-all(a)lists.01.org CC: linux-kernel(a)vger.kernel.org TO: Sumera Priyadarsini CC: Julia Lawall CC: Pantelis Antoniou CC: Frank Rowand CC: Rob Herring CC: devicetree(a)vger.kernel.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot drivers/of/overlay.c:788:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before goto around lines 799. Semantic patch information: False positives can be due to function calls within the for_each loop that may encapsulate an of_node_put. Generated by: scripts/coccinelle/iterators/for_each_child.cocci Fixes: 82c2d81361ec ("coccinelle: iterators: Add for_each_child.cocci script") CC: Sumera Priyadarsini Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: a349e4c659609fd20e4beea89e5c4a4038e33a95 commit: 82c2d81361ecd142a54e84a9da1e287113314a4f coccinelle: iterators: Add for_each_child.cocci script :::::: branch date: 25 hours ago :::::: commit date: 5 weeks ago Please take the patch only if it's a positive warning. Thanks! overlay.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -796,6 +796,7 @@ static int init_overlay_changeset(struct if (!fragment->target) { of_node_put(fragment->overlay); ret = -EINVAL; + of_node_put(node); goto err_free_fragments; }