From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============1309693099922449410==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: iterators: fix for_each_child.cocci warnings Date: Sat, 27 Mar 2021 22:34:33 +0800 Message-ID: <20210327143433.GA25580@57e046443ec4> In-Reply-To: <202103272251.Wyd5EQlV-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============1309693099922449410== 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: Liam Girdwood CC: Mark Brown CC: Jaroslav Kysela CC: Takashi Iwai CC: Ray Jui CC: Scott Branden CC: bcm-kernel-feedback-list(a)broadcom.com CC: Kuninori Morimoto From: kernel test robot sound/soc/bcm/cygnus-ssp.c:1346:1-33: WARNING: Function "for_each_available= _child_of_node" should have of_node_put() before return around line 1352. 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: 0f4498cef9f5cd18d7c6639a2a902ec1edc5be4e commit: 82c2d81361ecd142a54e84a9da1e287113314a4f coccinelle: iterators: Add= for_each_child.cocci script :::::: branch date: 19 hours ago :::::: commit date: 5 months ago Please take the patch only if it's a positive warning. Thanks! cygnus-ssp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/sound/soc/bcm/cygnus-ssp.c +++ b/sound/soc/bcm/cygnus-ssp.c @@ -1348,8 +1348,10 @@ static int cygnus_ssp_probe(struct platf &cygnus_ssp_dai[active_port_count]); = /* negative is err, 0 is active and good, 1 is disabled */ - if (err < 0) + if (err < 0) { + of_node_put(child_node); return err; + } else if (!err) { dev_dbg(dev, "Activating DAI: %s\n", cygnus_ssp_dai[active_port_count].name); --===============1309693099922449410==--