Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2915265rwb; Mon, 15 Aug 2022 14:00:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Sc6JSN1VrXoG+u7PDkhVCw4osMVQU7atDUuDTZq/um4UgeFSaz48wZowZx6JNlJfzjDKV X-Received: by 2002:a65:6d98:0:b0:41d:d9:a338 with SMTP id bc24-20020a656d98000000b0041d00d9a338mr15003405pgb.421.1660597201946; Mon, 15 Aug 2022 14:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597201; cv=none; d=google.com; s=arc-20160816; b=KjdB/o4WsYS78zgbC26D6ZVAgPjfoNs23kZfFrbMHP8pPBDASZvShhXzYABUbLFh8M SmYo1vNQWSuJ3JAv+SFHzoaNTkt6uL7ClXQarTBnlPPKBvvtGb6Cc2Ms6STbQeppw8yb a4Rs1kEc3Zg702Z+Ump+xerjtEaGnCmSW4L2ZwHjsJ5th7PElwqdiu00+XuneJNxr8aU PxolTKCu+NRkpSbW07q0nB/l6SIvIT/lrtaWaWv4Dl0OwVKTBn/ljunf/CIW6/ikKHJ6 7hKJzcf4dNKRwWt8uQG5HZkiK+QmVvtxOepDHajUAxjXVynqcDm9FRInyGmMxaikvvOW I9kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WfVMHE44KEgY/tmyTVUsD2cUIm9uyElbhuNIy6Sy3SA=; b=lO3h3HIQnFL2qL+UmHoqGv/FFPdFZpewJunVanWgAnfcximBa51Evh3tdZwSwN1CT4 ufnLsg1swCbKoxMf2EssCXDsI6LTzT6STiNED3L3CngC8HO3wcPocJSbTJyylbGGiDl7 Nut75coliFxT1Epnhuf4Td8n1BsVkE4TpEif88E8SvVa6A0yuXVnj1VH6uCKitr/skU0 uwBDhmuRhDqkDRHf1H1x9qQkevwCoaoAVaYf5iQjP/wBfjK0I4Q6bOm987wwGJx1R6H7 lTmWTfmDd4ZzG/8Y4fRYXNUmRsnjJAyPvpr+97Vr7tKeuch07D2DpepugBqW8+0QCxhP 8I3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H+foGp0D; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q24-20020a63f958000000b0041bc0b2cf83si11379786pgk.267.2022.08.15.13.59.50; Mon, 15 Aug 2022 14:00:01 -0700 (PDT) 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=pass header.i=@linuxfoundation.org header.s=korg header.b=H+foGp0D; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345981AbiHOUsX (ORCPT + 99 others); Mon, 15 Aug 2022 16:48:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345597AbiHOUrC (ORCPT ); Mon, 15 Aug 2022 16:47:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95449B7ED4; Mon, 15 Aug 2022 12:08:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4889960ACE; Mon, 15 Aug 2022 19:08:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B644DC4314E; Mon, 15 Aug 2022 19:08:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590526; bh=e2sA2q9BXuqDigMphbszovvhi7P2aY88fo3nVbXcMPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H+foGp0D1BLdMd3Fqy+FFdqUuttC5g1aYliAkoNRWVj67ZLLVHGTh2YDvg86kw8bv byjgAj5jamIu7Tnw6rcLxqYt05x6YEyNjqX4C5Twf/AMY+U2hTPFv0RcOPo0FaTkSq iJgdFrd/yGvopJVjMV1FcVI/ur19VSlGpBcwgXUY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Atish Patra , Andrew Jones , Will Deacon , Sasha Levin Subject: [PATCH 5.18 0287/1095] perf: RISC-V: Add of_node_put() when breaking out of for_each_of_cpu_node() Date: Mon, 15 Aug 2022 19:54:46 +0200 Message-Id: <20220815180441.663955223@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Liang He [ Upstream commit 491f10d08fdae10a177edf6af4f43b83b293114b ] In pmu_sbi_setup_irqs(), we should call of_node_put() for the 'cpu' when breaking out of for_each_of_cput_node() as its refcount will be automatically increased and decreased during the iteration. Fixes: 4905ec2fb7e6 ("RISC-V: Add sscofpmf extension support") Signed-off-by: Liang He Reviewed-by: Atish Patra Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20220715130330.443363-1-windhl@126.com Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- drivers/perf/riscv_pmu_sbi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c index fab0dd497393..77b826d6c05b 100644 --- a/drivers/perf/riscv_pmu_sbi.c +++ b/drivers/perf/riscv_pmu_sbi.c @@ -682,12 +682,15 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde child = of_get_compatible_child(cpu, "riscv,cpu-intc"); if (!child) { pr_err("Failed to find INTC node\n"); + of_node_put(cpu); return -ENODEV; } domain = irq_find_host(child); of_node_put(child); - if (domain) + if (domain) { + of_node_put(cpu); break; + } } if (!domain) { pr_err("Failed to find INTC IRQ root domain\n"); -- 2.35.1