From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387868; b=gCWxVGFK2u+NaipuU9PD2bjL0+NMgCjBKz9Y8sosiRm8BndhYBTTzhhUx9ZwGMRc4Ynx 74pduMzs0XVuBRq1THmtsK7HnzDYKCv3DQcD/iCQCeubYYPvA6/a+kDJL9oK6BXIL/rA+ oh6B60V7B0g7iHjxY3Wle3EQ21HGqUThulnsVUflI8RGJ4Wokz31fkb362Eebho6/H202 M7tSlg4bP5kn3uEwVDWiwevCumnQRrTsc+IM4V/kLq+nHGN1TDoW16dR6mG7VVmyzzd6u JHWw5RH3Sbd+QW8PAITPh4oIeoxyR4enHCuWsw6TJnDtB+uwskKmF3aEmHIGBXdRquA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387868; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=PNp8xONge4Ct0qoJryLd2Kfs/ARA5ayUR6/X30DmJTM=; b=hfi5d9WLBYURjVKpk/SajpjacXMgcf9o+uN3LxIQZ7CDwLRDojUzSTv0vyNEp23ZHlFa eCLV468cR/ObHHeJy6os7v5nxdLckXvvHjNZl4JqX5mETK8ENgHwLO5BFqGCdPNA6jsIz kmQQaL9b4QmI8chEd2er9I3oC9YJ6/D1QsxYjVNguLUdmTcQoge+8WDpJFK/u3P6f8DjJ 7JWUY/8XDQuDFXsSuGSNjnbWQtKzts16I1ruy1ZkbP/7xLXvLGr6ua5yLA9hHmHaoQFUj D65cgsdBxExqXcVyEU7l3zS4kBXZES60+MoIuQ7MbvoGgwnQGMGGyf08+htrIcVh1nA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=1BiDD2+C; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EB88606A322; Fri, 4 Dec 2026 12:37:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=1BiDD2+C Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC1B51F000C2; Fri, 4 Dec 2026 12:37:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387868; bh=PNp8xONge4Ct0qoJryLd2Kfs/ARA5ayUR6/X30DmJTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1BiDD2+CKfe4n3ff9Bb/1CG3SUwMGFi+bUh6ItkfGmYIuF/P63pTGWzmisHbbGRXE EOPHOrhkbQTAWBQlrE+y/g6Jyde4M1y+3J4Sue6K1djTsscUW5ElpEJn4SF9Jwp6wS iWlunL4t4WfMWzfu+jwumwN0gBpI1bqNiVSAPIs8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Haotian Zhang , Viresh Kumar , Sasha Levin Subject: [PATCH 6.1 0364/1059] cpufreq: qcom-cpufreq-hw: fix device node refcount leak in phandle parsing Date: Fri, 4 Dec 2026 18:58:15 +0900 Message-ID: <20261204100653.700274274@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Haotian Zhang [ Upstream commit 6fa50b1988b8dfd2e92a9cecba073fe4347a5e23 ] of_parse_phandle_with_args() transfers a reference to the provider node in out_args->np, which the caller is responsible for releasing with of_node_put(). Neither qcom_get_related_cpus() nor qcom_cpufreq_hw_cpu_init() ever puts args.np: they only put cpu_np, which is a different node obtained from of_cpu_device_node_get(). The reference is therefore leaked on every successful call, and qcom_get_related_cpus() leaks one per present CPU. Release args.np after the parsed index has been read in both call sites. Fixes: 2849dd8bc72b ("cpufreq: qcom-hw: Add support for QCOM cpufreq HW driver") Assisted-by: DeepSeek-V4.1-Flash Signed-off-by: Haotian Zhang Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/cpufreq/qcom-cpufreq-hw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 749b60c78da5d..ba9a800e77c71 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -311,6 +311,8 @@ static void qcom_get_related_cpus(int index, struct cpumask *m) if (index == args.args[0]) cpumask_set_cpu(cpu, m); + + of_node_put(args.np); } } @@ -531,6 +533,7 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) return ret; index = args.args[0]; + of_node_put(args.np); res = platform_get_resource(pdev, IORESOURCE_MEM, index); if (!res) { -- 2.53.0