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: 12895775 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 6FFC7C43334 for ; Sun, 26 Jun 2022 14:20:05 +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=9BZcdRKhLeGqkM69LBYsSuYNRMc4SKvftJBxlvP4Xic=; b=FdFemWZ0qznJNK 0J1reT/yS5HzZnsg+MvNX/K+nOn3Ien3/12KVdU+ps7nutXB7TPQ8vEDbRuaSXTG/vEnuFWqMMDhi pAm8P/IcD5ZCZkkM26NEEU5szf02t786cSb8Zo7bhcq4ONodahiDAttsmV9OZRHazWKlIeigDbYIK mnAWCtP3QsyUM5uFheMRThundp4kD5IlUsrxm6itTKxl6qCHpbIKX1vFtsQAgR5cyHIx6qZZsHtCU T9A61iJN8t1wVLhAW4T/aaitcuUHSp8jTWkXJQhIQaSHpeKvWOkA7A65Rqn/a9vMjdoGHu7JCZos+ XNERqC7uTaud6HveDfLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o5T6P-00C7zH-5m; Sun, 26 Jun 2022 14:19:05 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o5T6L-00C7wi-1H for linux-arm-kernel@lists.infradead.org; Sun, 26 Jun 2022 14:19:03 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220626_071901_569780_DE83D2DF X-CRM114-Status: GOOD ( 13.24 ) 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_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; } }