All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: analogix_dp: Fix runtime PM refcount leak in set_bridge()
@ 2026-10-30  8:28 laixiangwu
  2026-10-30  8:37 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: laixiangwu @ 2026-10-30  8:28 UTC (permalink / raw)
  To: Andrzej Hajda, Neil Armstrong, Robert Foss, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: Laurent Pinchart, Jonas Karlman, Jernej Skrabec, Luca Ceresoli,
	dri-devel, linux-kernel, laixiangwu

analogix_dp_set_bridge() calls pm_runtime_get_sync() to power up the
DP core, but if the subsequent analogix_dp_init_analog_func() fails it
returns the error directly, without the matching pm_runtime_put_sync().
The two other error paths in the function already jump to the
out_dp_init label, which drops the reference.

Every failed bridge enable therefore increments the runtime PM usage
counter, and repeated failures (e.g. during hotplug storms) prevent
the device from ever runtime suspending again.

Jump to out_dp_init like the other error paths so the runtime PM
reference is released.

Fixes: 3efe2ace7f5b ("drm/bridge: analogix_dp: move basic controller init into runtime PM")
Signed-off-by: laixiangwu <laixiangwu@cmss.chinamobile.com>
---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 6df696374..c9c1375a9 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -998,7 +998,7 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
 
 	ret = analogix_dp_init_analog_func(dp);
 	if (ret)
-		return ret;
+		goto out_dp_init;
 
 	/*
 	 * According to DP spec v1.3 chap 3.5.1.2 Link Training,



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

end of thread, other threads:[~2026-10-30  9:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30  8:28 [PATCH] drm/bridge: analogix_dp: Fix runtime PM refcount leak in set_bridge() laixiangwu
2026-10-30  8:37 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.