Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6138571iog; Thu, 23 Jun 2022 12:09:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sgdG9v9tqdhHjRsAAs4950g7nmctDTR3GxBCMdECGAwhSipreJCSVp35M05QunQptKnS3A X-Received: by 2002:a65:6d0f:0:b0:3fd:8437:c35b with SMTP id bf15-20020a656d0f000000b003fd8437c35bmr8407441pgb.24.1656011341487; Thu, 23 Jun 2022 12:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656011341; cv=none; d=google.com; s=arc-20160816; b=oVXpKm8qXMELW+KBpzDTZmMYNgftrZknrrszZQUD8lJgRAXFK1I6g1qDADa7Mnwa3l +hm2vLC4+daVr4XWCNq4y2owNuPU1n8zIfJl59holQcipzrQbJHJFGdZpPK1VoNqw+Jl I+n2AFBYdLdZ+DPOGWnr5XjPuFD0imvWxHBA1vgfzeYCejM1KGXAiW8/h6etkokjqSks VdC1rTBYIVl5NmXcl2ztXi9pAAD2XJaMvmD1xl03ZaoU9DqjOh4tUnRS1+clq0Y109jx vH+ty/dOUsinrqgo6dBmzcCYXmZHGhRV+FgVrowRP80k6gH6rt6c+IDSbs7XYVjLfvBA T8pg== 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=W/PJJdN+ZTX67Q2yyvKmQTZB7XMizqwSp0v0U5YiE68=; b=z+2yEZJjOkkhtAapCxGdIq1T+1ynnwtptoOMyKT+BXpRQRi6zSzZ/vJca5GYUrurOP dJ2FFLGTZlKWGJF1fcWuzUsr/YpS/S46Ev9EJFnBKVfS5qR62WanZ572owZprunBhTkC NCrC1UU/pFGkALdkknWdec4y/Qy6z5r5RcWOgi+TLginIDPJJxYsCajkiy5iMhOyAlRb nlwC8zvrB/1cxmkY2k1MOGrRKzDvgyL72R98fg9cFWlOXtvUhzUUbxtxqvIdDEZTO3Mo N+hRnG4h60Zb5jXg6/OKgWS4wcdrIICpL8J03Ou6wDvEIMtsjOhbBwBYHPQcBl5jzZBm T/3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DDJZy5Vz; 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 g11-20020a63f40b000000b003a1d18a5386si28135238pgi.17.2022.06.23.12.08.49; Thu, 23 Jun 2022 12:09: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=DDJZy5Vz; 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 S237112AbiFWSWO (ORCPT + 99 others); Thu, 23 Jun 2022 14:22:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237288AbiFWSSI (ORCPT ); Thu, 23 Jun 2022 14:18:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04C31B6232; Thu, 23 Jun 2022 10:24:34 -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 8282E61EDF; Thu, 23 Jun 2022 17:24:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EDD5C3411B; Thu, 23 Jun 2022 17:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656005072; bh=Tt6bvSYV1elYwtR3mC25cMJKwSNpilbWgWHly4ISBR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DDJZy5VzuRfA668e/szfaNVXB49+5NKnePdo47mMdRQBPfGkHpSeDH52Sf7TlqbQa NLa7x23vWBbemJKDEVY6dHHgCikXmwJrwg+/OhA5ZR3anCyKz/JV96u+Ufyj9Dqa8/ 7t3DLVxSiSnvzdV3noQAIkDirbAGAzg4TI5Qj9Qo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Marc Zyngier , Sasha Levin Subject: [PATCH 4.19 210/234] irqchip/gic-v3: Fix refcount leak in gic_populate_ppi_partitions Date: Thu, 23 Jun 2022 18:44:37 +0200 Message-Id: <20220623164348.993055517@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623164343.042598055@linuxfoundation.org> References: <20220623164343.042598055@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 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: Miaoqian Lin [ Upstream commit fa1ad9d4cc47ca2470cd904ad4519f05d7e43a2b ] of_find_node_by_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: e3825ba1af3a ("irqchip/gic-v3: Add support for partitioned PPIs") Signed-off-by: Miaoqian Lin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220601080930.31005-6-linmq006@gmail.com Signed-off-by: Sasha Levin --- drivers/irqchip/irq-gic-v3.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 05b9a4cdc8fd..8d8b8d192e2e 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1205,12 +1205,15 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node) continue; cpu = of_cpu_node_to_id(cpu_node); - if (WARN_ON(cpu < 0)) + if (WARN_ON(cpu < 0)) { + of_node_put(cpu_node); continue; + } pr_cont("%pOF[%d] ", cpu_node, cpu); cpumask_set_cpu(cpu, &part->mask); + of_node_put(cpu_node); } pr_cont("}\n"); -- 2.35.1