Message ID | Y+kFyUVMkfuugwit@ubun2204.myguest.virtualbox.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1948289wrn; Sun, 12 Feb 2023 07:41:46 -0800 (PST) X-Google-Smtp-Source: AK7set8p4N+TxUdHCZGsuso7QCnSBSP30xQACZfm+LNZ/VKTaFqZ+/hr+Z/Owdmg1/zS8AMHA9MI X-Received: by 2002:a62:6146:0:b0:5a8:ac0f:e116 with SMTP id v67-20020a626146000000b005a8ac0fe116mr2300948pfb.24.1676216505885; Sun, 12 Feb 2023 07:41:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676216505; cv=none; d=google.com; s=arc-20160816; b=bp1X3gIztFMRb8JuZ9+ZLuTXdoNbF2/8CroYQjv+1majt0yPU45C8OqGh8Shvp1uKk 8diLm36HGANeVOqx1LQE/hUTEnURQyiN/XPRzoGZ7ztDTqG7rDTzfuGsOprv89PRcBvH 8ZyVT4oEPNxKdpmrL3vHRA4RILQiMP5zOBSdnf1fnlw6tvHLX20QGDHbesWvjBf5aPlz AYrmhd4XpvYSfO33NjGiYGB4AECUC+gjTCfkuOLT1vyNvPWJjqS+2SgG6RxfAHKkcgA7 +GLyAPRVXTgE+ty4tOQhOXbtv0/tRUVfmwNVO1f8As+NY+i8WCxjthcGtnSQftttJKvj lsfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=YcMkJ5Pn4Bc8IQIqgyU4SkOu9JorjV08nl4FW8glRMU=; b=iHcLfb8/8ZXaj/79A7L/WtKMpFxkFqub3sXg7J2u4BUmdb0n7DE/788vmgTL0rEYn4 8FG608w8jUV1go3N0J7VMVGTBREZhVP3MqgjXOJYAldu7Ni7wwD9Q5coSFn+gEixuvGc Lszj7xEk3SFhZEUMYT8o61bdYAVP4u3Dx5HrygTAq7bkEQ/vISE10iF7lyjlL6b6s+a3 DMnpo5z8htvYgmQ5ntYb4fDIJt6Vk/0NLbrrc23Yv+YdG9b2bXO4vNeX+KHQJnUcm2dG aysxD+k3l28hjvyaNdshoF9+JwQk4v4gKwhnz/zzCukkD8e+L8xjNQKlx58cY9bcUy5s wY5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=nJ8hp41y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w14-20020aa79a0e000000b0059becf3743bsi10216163pfj.35.2023.02.12.07.41.33; Sun, 12 Feb 2023 07:41:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=nJ8hp41y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229625AbjBLP3U (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Sun, 12 Feb 2023 10:29:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbjBLP3T (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 12 Feb 2023 10:29:19 -0500 Received: from msg-4.mailo.com (msg-4.mailo.com [213.182.54.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A98CB7EE8 for <linux-kernel@vger.kernel.org>; Sun, 12 Feb 2023 07:29:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1676215756; bh=dPUMsgqR29ABs8e2run37C3ERVUnBw1c2pLvg81OOHg=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=nJ8hp41yNBG92dISTJ4UvJAu82w9D03rmvyeeSeUaQ/01YBT5bBB4PfKNcO0MllPt vLA3wuYNvcqI1VW4ZBIPz21gbs0ma6P+FVLTwrUiK9lLKCvgzqyLXI8x6cCa91KupO ZD4sBVKrdyiGonDRA6vrIV2LV2wOGQ43PiYQwyuA= Received: by b-5.in.mailobj.net [192.168.90.15] with ESMTP via ip-206.mailobj.net [213.182.55.206] Sun, 12 Feb 2023 16:29:16 +0100 (CET) X-EA-Auth: H1Q8A0ov/kkUeRXY7osnEJ9nyK8Oy9KBvib/acfOppXaJMMDA5iHVdu1/+BXf7YCSNAkP/szIa4PUCCdFWuq3Q4gBz5qUEmh Date: Sun, 12 Feb 2023 20:59:13 +0530 From: Deepak R Varma <drv@mailo.com> To: linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar <ssengar@microsoft.com>, Praveen Kumar <kumarpraveen@linux.microsoft.com>, Deepak R Varma <drv@mailo.com> Subject: [PATCH] bus: arm-cci: release node before breaking child_of_node loop Message-ID: <Y+kFyUVMkfuugwit@ubun2204.myguest.virtualbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757640399139498783?= X-GMAIL-MSGID: =?utf-8?q?1757640399139498783?= |
Series |
bus: arm-cci: release node before breaking child_of_node loop
|
|
Commit Message
Deepak R Varma
Feb. 12, 2023, 3:29 p.m. UTC
The iterator for_each_available_child_of_node() increments the refcount
of the child node it is processing. Release such a reference when the
loop needs to break due to an error during its execution.
Issue identified using for_each_child.cocci Coccinelle semantic patch.
Signed-off-by: Deepak R Varma <drv@mailo.com>
---
Please note: The proposed change is compile tested only. I do not have the
necessary hardware to perform additional testing. Please suggest if there is an
alternate means available to further test this change.
drivers/bus/arm-cci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c index b8184a903583..1f84a5528073 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c @@ -461,8 +461,10 @@ static int cci_probe_ports(struct device_node *np) i = nb_ace + nb_ace_lite; - if (i >= nb_cci_ports) + if (i >= nb_cci_ports) { + of_node_put(cp); break; + } if (of_property_read_string(cp, "interface-type", &match_str)) {