From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0450627236428362810==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: iterators: fix for_each_child.cocci warnings Date: Sun, 21 Mar 2021 15:14:19 +0800 Message-ID: <20210321071419.GA5350@80f861dc5a78> In-Reply-To: <202103211551.H9TYAXa6-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============0450627236428362810== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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" s= hould 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 scrip= t") 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: 812da4d39463a060738008a46cfc9f775e4bfcf6 commit: 82c2d81361ecd142a54e84a9da1e287113314a4f coccinelle: iterators: Add= for_each_child.cocci script :::::: branch date: 13 hours ago :::::: commit date: 5 months 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 =3D -EINVAL; + of_node_put(node); goto err_free_fragments; } =20 --===============0450627236428362810==--