From patchwork Wed Jun 23 14:23:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 12339969 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43D94C4743C for ; Wed, 23 Jun 2021 14:25:21 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0A3BA610C7 for ; Wed, 23 Jun 2021 14:25:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A3BA610C7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=jx1RG2/yI4DKbbdDY0G1W+xjL2odhVrc9ZeriLsrdsc=; b=MmrfPAWo8Q/Eyh oBOL0Vr3gEIK/0RlIrXIX/PpzOAqXMWOos7W6Y/KMtLtdpWO3DoE/JRygnHdCXnsTH5vuH+yhBwTf 9FVhgFogv6xnvwFzHyLBudrph6ApIbHbqfDkO5MRu+//vbMcLmaJRu7hQN8MHZO46cvzBPhD5N176 eApxBz4DKVUe2N5rZeDQGI70yQSmP68rIsXDPNwQoreYX3NOBVCqgxjaQf+JvAlbk6PvRWXna3pRY fmhB+Oth2Vccq1vFTJ9EMNuEC4wTSHoKD3KuSBK+6eaIb5uA9eVgCuhCp2wMj3xcdvmVBXz8Wkbyu hRwPx8fGyBA3GmznNVeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lw3n5-00AzPd-Tg; Wed, 23 Jun 2021 14:23:44 +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 1lw3n1-00AzNw-9H; Wed, 23 Jun 2021 14:23:41 +0000 IronPort-HdrOrdr: A9a23:mZRX1a4u+U/5/calGgPXwMPXdLJyesId70hD6qkRc202TiX2rauTdZggvyMc6wxhO03I++rgBEDoexq1yXcf2+cs1NmZMDUO9FHJEKhSqbqn+THmFiHkn9Qx6Y5recFFZ+HNMQ== X-IronPort-AV: E=Sophos;i="5.83,294,1616454000"; d="scan'208";a="385935401" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jun 2021 16:23:31 +0200 Date: Wed, 23 Jun 2021 16:23:30 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Sumera Priyadarsini Subject: [PATCH] phy: rockchip-inno-usb2: 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-20210623_072339_683876_946705C6 X-CRM114-Status: GOOD ( 11.67 ) 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 break around line 1184. The other jumps out of the loop do contain the put. Generated by: scripts/coccinelle/iterators/for_each_child.cocci CC: Sumera Priyadarsini Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 0c18f29aae7ce3dadd26d8ee3505d07cc982df75 commit: 82c2d81361ecd142a54e84a9da1e287113314a4f coccinelle: iterators: Add for_each_child.cocci script :::::: branch date: 20 hours ago :::::: commit date: 8 months ago Please take the patch only if it's a positive warning. Thanks! phy-rockchip-inno-usb2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1180,8 +1180,10 @@ static int rockchip_usb2phy_probe(struct next_child: /* to prevent out of boundary */ - if (++index >= rphy->phy_cfg->num_ports) + if (++index >= rphy->phy_cfg->num_ports) { + of_node_put(child_np); break; + } } provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);