From patchwork Tue Feb 8 20:51:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 12739300 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 EA482C433EF for ; Tue, 8 Feb 2022 20:53:32 +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=dmaYP87T9u4Qg7g+t4LXpsDZm7rHly1ixnDt/4vtnLQ=; b=r2m8xZJcRhFbQN luRNCiqF7tw+91teQ34XMgByUZimDRrcsuJCoAqtv6eXoiuvhT22wR7ADSmRHf8Jh6Jc3mwlUaUL9 sOZeZPZ9IHK7luZ69+z77KGte5J61VY9OljLqL2Lu55zJq1RerGE5r4ag3NkV/Z44cqD+Nm987+XI pu298Q6EX1Bvm64A+LO5+s4udUzQ1DA9+IagJjTYqQK7xnJ68xesMFaUB4D84VUC+wtWQr+QKMS9F 11rjrmsu/DoajMygupo9he69weycNVIs/5yCWZSHwvHH20BM3tGQY1q5QEgAL19aHaXSX7uD/yxkM UYOZoPsaAZmn8+M2URXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHXSb-00FXWe-2t; Tue, 08 Feb 2022 20:51:37 +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 1nHXSW-00FXW0-M8 for linux-arm-kernel@lists.infradead.org; Tue, 08 Feb 2022 20:51:34 +0000 X-IronPort-AV: E=Sophos;i="5.88,353,1635199200"; d="scan'208";a="20363149" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2022 21:51:31 +0100 Date: Tue, 8 Feb 2022 21:51:30 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Amit Kumar Mahapatra , Michal Simek , Sai Krishna Potthuri , Tejas Prajapati Rameshchandra , Naga Sureshkumar Relli , Shubhrajyoti Datta , Ricardo Ribalda Delgado , Mark Brown cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] spi: spi-xilinx: 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-20220208_125133_017786_A493B7A3 X-CRM114-Status: GOOD ( 10.72 ) 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 After for_each_available_child_of_node, of_node_put is needed before break and return. Generated by: scripts/coccinelle/iterators/for_each_child.cocci Fixes: 3973536c4560 ("spi: spi-xilinx: Updated axi-qspi controller driver") CC: Amit Kumar Mahapatra Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall Signed-off-by: Ricardo Ribalda --- tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15 head: 1183ce490adb103e5e569b8ebd74c50c885ddc05 commit: 3973536c456079bf3d09e9a97bf33d29422b183f [861/872] spi: spi-xilinx: Updated axi-qspi controller driver :::::: branch date: 7 days ago :::::: commit date: 7 days ago spi-xilinx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c @@ -693,13 +693,16 @@ static int xilinx_spi_probe(struct platf if (startup_block) { ret = of_property_read_u32(nc, "reg", &cs_num); - if (ret < 0) + if (ret < 0) { + of_node_put(nc); return -EINVAL; + } } ret = of_property_read_u32(nc, "spi-rx-bus-width", &rx_bus_width); if (!ret) { xspi->rx_bus_width = rx_bus_width; + of_node_put(nc); break; } }