From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE620CA6F; Sat, 12 Sep 2026 14:32:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789223563; cv=none; b=SAxiZUPoMikRw8nDj7O90NhrIh/NebbPB5+TTFY5UQSqMNoUuHpLwDU6hxEPrcSW88YkqscRdx0s89hGeF8zkZRwftsmcewI9B8CChYn90WevfN4seohcC783LCK8LtS1QTjYb34RqLpNo0nEFqPqzYZOiL/hroQ/hRVlEXsHCY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789223563; c=relaxed/simple; bh=0Z3ejcO0G+BYYgaI1SsMXNTTye2RYOBySIc7NmUqVOk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X2g2cPFdzn4l94sSuLeXWTIPfTjqSIkKeNtx82I3PZ8o7KW9aV9iwdp6rucNYcaAzRHGf75XgbH/c21k12MpO4y5gY8gbg67BcNvbsr184zSy20C9z63c+afKjr0Is3vGsCko73OdjpZ9FgXyD6s9WIpe5hCiDqsqaMQvQsdyD0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yl1x9lnB; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yl1x9lnB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C3051F000FF; Sat, 12 Sep 2026 14:32:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789223562; bh=bpY5pRKzT9GgBy551u6iyTQhpe8Io7XtMBQInUYoN9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yl1x9lnBnl5nxoDU7k+0ex3IoV45pbVyyDl5BVBHO3/DQu/VS7HdmOWDmNTlcdIG/ uPWUSrgAGhbXOKIJTmO7EdRhsD++GL/COlAkHs7gw1aBXhT1LUoiFN3zI+dTOqJAFC A4dKLAuZBM1Xw7I2+Q3wg/KxZJiAMmwCteBJCgCw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Uday Khare , Bjorn Andersson , Sasha Levin Subject: [PATCH 6.6 0772/1424] remoteproc: qcom: Fix glink->node reference leak in qcom_add_glink_subdev Date: Sat, 12 Sep 2026 08:53:24 +0200 Message-ID: <20260912065624.585311183@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Uday Khare [ Upstream commit 44f4911ab8e6f4d69afad5f2571bbd2da421c918 ] In qcom_add_glink_subdev(), the device node reference acquired via of_get_child_by_name() is stored in glink->node. If the subsequent kstrdup_const() allocation for glink->ssr_name fails, the function returns early without calling of_node_put() on glink->node, leaking the reference count. Fix this by adding of_node_put(glink->node) on the error path before returning. Fixes: cd9fc8f1b35b ("remoteproc: qcom: Pass ssr_name to glink subdevice") Signed-off-by: Uday Khare Link: https://lore.kernel.org/r/20260618132054.11010-1-udaykhare77@gmail.com Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/remoteproc/qcom_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c index e5b1f0e66019f..301cd16723709 100644 --- a/drivers/remoteproc/qcom_common.c +++ b/drivers/remoteproc/qcom_common.c @@ -240,8 +240,10 @@ void qcom_add_glink_subdev(struct rproc *rproc, struct qcom_rproc_glink *glink, return; glink->ssr_name = kstrdup_const(ssr_name, GFP_KERNEL); - if (!glink->ssr_name) + if (!glink->ssr_name) { + of_node_put(glink->node); return; + } glink->dev = dev; glink->subdev.start = glink_subdev_start; -- 2.53.0