mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/4] remoteproc: qcom: Fix glink->node reference leak in qcom_add_glink_subdev
@ 2026-06-18 13:20 Uday Khare
  2026-07-01 11:30 ` (subset) " Mark Brown
  2026-07-10 18:07 ` Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Uday Khare @ 2026-06-18 13:20 UTC (permalink / raw)
  To: andersson, mathieu.poirier
  Cc: linux-arm-msm, linux-remoteproc, linux-kernel, Uday Khare

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 <udaykhare77@gmail.com>
---
 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 fd2b6824ad26..8af90d4bdbdf 100644
--- a/drivers/remoteproc/qcom_common.c
+++ b/drivers/remoteproc/qcom_common.c
@@ -247,8 +247,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.54.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: (subset) [PATCH 1/4] remoteproc: qcom: Fix glink->node reference leak in qcom_add_glink_subdev
  2026-06-18 13:20 [PATCH 1/4] remoteproc: qcom: Fix glink->node reference leak in qcom_add_glink_subdev Uday Khare
@ 2026-07-01 11:30 ` Mark Brown
  2026-07-10 18:07 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-07-01 11:30 UTC (permalink / raw)
  To: andersson, mathieu.poirier, Uday Khare
  Cc: linux-arm-msm, linux-remoteproc, linux-kernel

On Thu, 18 Jun 2026 18:50:54 +0530, Uday Khare wrote:
> remoteproc: qcom: Fix glink->node reference leak in qcom_add_glink_subdev

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-7.3

Thanks!

[4/4] regulator: tps6594: Fix device node reference leaks in multiphase loop
      https://git.kernel.org/broonie/regulator/c/7fd28093b3ef

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: (subset) [PATCH 1/4] remoteproc: qcom: Fix glink->node reference leak in qcom_add_glink_subdev
  2026-06-18 13:20 [PATCH 1/4] remoteproc: qcom: Fix glink->node reference leak in qcom_add_glink_subdev Uday Khare
  2026-07-01 11:30 ` (subset) " Mark Brown
@ 2026-07-10 18:07 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2026-07-10 18:07 UTC (permalink / raw)
  To: mathieu.poirier, Uday Khare; +Cc: linux-arm-msm, linux-remoteproc, linux-kernel


On Thu, 18 Jun 2026 18:50:54 +0530, Uday Khare wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/4] remoteproc: qcom: Fix glink->node reference leak in qcom_add_glink_subdev
      commit: ed5dd2a9b716568ff7d6446322ee60846af313aa

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-10 18:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-18 13:20 [PATCH 1/4] remoteproc: qcom: Fix glink->node reference leak in qcom_add_glink_subdev Uday Khare
2026-07-01 11:30 ` (subset) " Mark Brown
2026-07-10 18:07 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®