From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BD69C433FE for ; Sun, 13 Feb 2022 16:22:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237090AbiBMQW3 (ORCPT ); Sun, 13 Feb 2022 11:22:29 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233353AbiBMQW2 (ORCPT ); Sun, 13 Feb 2022 11:22:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 941585A584; Sun, 13 Feb 2022 08:22:22 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4228EB80B33; Sun, 13 Feb 2022 16:22:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6FF7C340F0; Sun, 13 Feb 2022 16:22:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644769339; bh=czxEEr/GBsTWRl7yYnSsYAZb/4+oUEgjhNhdXN4Iiio=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GfCp0kr4KenvGejya3Gs83lT4nlL53uGu0IiIJC88tM5xZzkGjxT3hZRZ7kjiE2Rd NCdZz/L0DUrnSFhN6e2748W3yNhFOmCmc/eJUqk1Z/9jxfUa84AiaDW9urYdYRXzQb dcTPMhJD8hFrQTqiceV+fj82UYRmveAlERcXu3Zc+tK8ij9tb04t8yuVQwtY5Tu9vs HYhJQMDFLyK5jofVj1GlwGnYorbI4m3SfVie9XI6kUlQPS8tC+Jnaq96k6G1IPZE+l CvfQ0KQ2NY3Q0ZTAc/r0wNsqyn8lI4kDO98aBx49OlbkhuZO3eFjCdabfUAe0V201k 0yibIHcWHWhrw== Date: Sun, 13 Feb 2022 16:28:59 +0000 From: Jonathan Cameron To: Julia Lawall , Lars-Peter Clausen Cc: Anand Ashok Dumbre , kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org, Michal Simek , Dragan Cvetic , git@xilinx.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: versal-sysmon: fix for_each_child.cocci warnings Message-ID: <20220213162859.3d968256@jic23-huawei> In-Reply-To: References: X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 12 Feb 2022 23:39:33 +0100 (CET) Julia Lawall wrote: > From: kernel test robot > > For_each_child_of_node" should have of_node_put() before return. > > Generated by: scripts/coccinelle/iterators/for_each_child.cocci > > CC: Anand Ashok Dumbre > Reported-by: kernel test robot > Signed-off-by: kernel test robot > Signed-off-by: Julia Lawall > > --- > > tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15 > head: 966124532656bc95d781abf57531e4cd4f962237 > commit: 1459646ab280aa68c3c4fa1d9552ea21f15d7a2d [543/923] iio: versal-sysmon: add driver for Versal Sysmon > :::::: branch date: 3 days ago > :::::: commit date: 12 days ago > > Please take the patch only if it's a positive warning. Thanks! Patch is obviously correct, but this driver isn't upstream so from point of view of the IIO tree I'm ignoring this. Thanks, Jonathan > > versal-sysmon.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > --- a/drivers/iio/adc/versal-sysmon.c > +++ b/drivers/iio/adc/versal-sysmon.c > @@ -875,12 +875,16 @@ static int sysmon_parse_dt(struct iio_de > > for_each_child_of_node(np, child_node) { > ret = of_property_read_u32(child_node, "reg", ®); > - if (ret < 0) > + if (ret < 0) { > + of_node_put(child_node); > return ret; > + } > > ret = of_property_read_string(child_node, "xlnx,name", &name); > - if (ret < 0) > + if (ret < 0) { > + of_node_put(child_node); > return ret; > + } > > sysmon_channels[i].type = IIO_VOLTAGE; > sysmon_channels[i].indexed = 1;