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: 541044 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 485F4C43217 for ; Tue, 8 Feb 2022 22:26:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386531AbiBHWZs (ORCPT ); Tue, 8 Feb 2022 17:25:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386535AbiBHUve (ORCPT ); Tue, 8 Feb 2022 15:51:34 -0500 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC0E8C0612C3; Tue, 8 Feb 2022 12:51:32 -0800 (PST) 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 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.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 --- 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; } }