From patchwork Sun Jun 26 14:18:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 12895777 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 E2A39C433EF for ; Sun, 26 Jun 2022 14:18:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231880AbiFZOS6 (ORCPT ); Sun, 26 Jun 2022 10:18:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230263AbiFZOS6 (ORCPT ); Sun, 26 Jun 2022 10:18:58 -0400 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93A05F5A6; Sun, 26 Jun 2022 07:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:message-id:mime-version; bh=vzW2YDRivUkEO4rC4lUegfnhHyISjIWJzq59gdpykCQ=; b=rHA5vqkyohCJW8XjTj30zOhL2h5IvAqfOdurbGTKJn5TwsYPAA1DRptT 4QlLPXsjVSYFs+U3Az7w577ddVQgbAmOpvceJDWqM1kzXoymCZD04A4Di k786NqIasjDg9TjQqUsYwUcxHFOXDB2zxWAVhOotfxBx5BD4mxYlNv79n E=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.92,224,1650924000"; d="scan'208";a="17794886" Received: from 71-219-36-202.chvl.qwest.net (HELO hadrien) ([71.219.36.202]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2022 16:18:50 +0200 Date: Sun, 26 Jun 2022 10:18:46 -0400 (EDT) From: Julia Lawall X-X-Sender: julia@hadrien To: Amit Kumar Mahapatra cc: kbuild-all@lists.01.org, lkp@intel.com, linux-arm-kernel@lists.infradead.org, Michal Simek , Sai Krishna Potthuri , Tejas Prajapati Rameshchandra , Naga Sureshkumar Relli , Shubhrajyoti Datta , Ricardo Ribalda Delgado , Mark Brown , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.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 for_each_available_child_of_node should have of_node_put() before return around line 697. for_each_available_child_of_node should have of_node_put() before break around line 703. 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_LTS head: 59523b5c4aca0174f1f8cba2a07d3b3328b7c80e commit: 3973536c456079bf3d09e9a97bf33d29422b183f [861/1181] spi: spi-xilinx: Updated axi-qspi controller driver :::::: branch date: 5 days ago :::::: commit date: 5 months ago Please take the patch only if it's a positive warning. Thanks! drivers/spi/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; } }