From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6204073932679832011==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] iio: adc: fix for_each_child.cocci warnings Date: Sat, 26 Mar 2022 08:39:06 +0800 Message-ID: <20220326003906.GA66721@3ea3647cd229> In-Reply-To: <202203260819.6o9L0nMg-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============6204073932679832011== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com CC: linux-arm-kernel(a)lists.infradead.org TO: Rajnikant Bhojani CC: Michal Simek CC: Hyun Kwon CC: Shubhrajyoti Datta CC: "Jean-Francois Dagenais" CC: Olivier Dugas CC: Manish Narani CC: Jonathan Cameron CC: "Lars-Peter Clausen" CC: linux-iio(a)vger.kernel.org CC: linux-arm-kernel(a)lists.infradead.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot drivers/iio/adc/xilinx-ams.c:917:1-23: WARNING: Function "for_each_child_of= _node" should have of_node_put() before return around line 923. 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 CC: Rajnikant Bhojani Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15_LTS head: 1870e0fa79a9d58c6748c34550f3ccea0b515933 commit: d073b83d3f8f3ba83c59f7502371b1cf9eb35e92 [541/1029] iio: adc: Add X= ilinx AMS driver :::::: branch date: 35 hours ago :::::: commit date: 8 weeks ago Please take the patch only if it's a positive warning. Thanks! drivers/iio/adc/xilinx-ams.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/iio/adc/xilinx-ams.c +++ b/drivers/iio/adc/xilinx-ams.c @@ -920,6 +920,7 @@ static int ams_parse_dt(struct iio_dev * ams_channels + num_channels); if (ret < 0) { kfree(ams_channels); + of_node_put(child_node); return ret; } =20 --===============6204073932679832011==--