From patchwork Sat Feb 12 22:39:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 12744447 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D33C9C433F5 for ; Sat, 12 Feb 2022 22:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8/hX9pkgUMHk1jWlw3uhNQzkN25RlBUqRzBS2XDPIEw=; b=ykdGE0dgdMPx4r n41xiFL7AQ/ieBB3dvR1uGxlsNL3Acv1T09OjQGrrGBiw8RUVNcU71BBmwwbttTpp73u9B49xPVCk PKxmg5O4MZN5+2c/s9LwsybRazoa3rrJG986LNIv0r4NCfWvIjsaXrFogfgMGIGJ04Udo60Cljhju 3ipUB84+x/1T9pcYgjjgkQe8ithP9Zlw+X7RezI8tQgfCRgGYfk+KhZuf9nSp3rUKvcJS0lg1wG6q y1U4PXq+BPgkb8TZmQFnVpnSRV4+TOQ/agoJ8QfBfbXI//qYm+76PKCvSPLX0Izohh1cHzuPZR6MZ CKlR/4Ejuwlzlfb3hOjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJ13P-00Add5-Da; Sat, 12 Feb 2022 22:39:43 +0000 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJ13M-00AdcJ-Af for linux-arm-kernel@lists.infradead.org; Sat, 12 Feb 2022 22:39:42 +0000 X-IronPort-AV: E=Sophos;i="5.88,364,1635199200"; d="scan'208";a="21055354" Received: from 203.107.68.85.rev.sfr.net (HELO hadrien) ([85.68.107.203]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2022 23:39:33 +0100 Date: Sat, 12 Feb 2022 23:39:33 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Anand Ashok Dumbre cc: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org, Michal Simek , Dragan Cvetic , Jonathan Cameron , Lars-Peter Clausen , git@xilinx.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] iio: versal-sysmon: fix for_each_child.cocci warnings Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220212_143940_665230_1F065704 X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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! 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;