Skip to contentSkip to conversation

drm: bridge: cdns-mhdp8546: Fix missing mutex unlock on error path

PATCH Applied Qi Xi 2 participants 3 messages Sep 4, 2025 – Sep 16, 2025

Subsystems (3)
lore
Share & tools
lore

Qi Xi

author
#0 lore raw

PATCH 1/1 drm: bridge: cdns-mhdp8546: Fix missing mutex unlock on error path

Add missing mutex unlock before returning from the error path in cdns_mhdp_atomic_enable().

Fixes 935a92a1c400 ("drm: bridge: cdns-mhdp8546: Fix possible null pointer dereference")
---
 drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +4 -2
index a614d1384f71..38726ae1bf15 100644
@@ -1984,8 +1984,10 @@ static void cdns_mhdp_atomic_enable(struct drm_bridge *bridge,
 	mhdp_state = to_cdns_mhdp_bridge_state(new_state);
 
 	mhdp_state->current_mode = drm_mode_duplicate(bridge->dev, mode);
-	if (!mhdp_state->current_mode)
-		return;
+	if (!mhdp_state->current_mode) {
+		ret = -EINVAL;
+		goto out;
+	}
 
 	drm_mode_set_name(mhdp_state->current_mode);
 
Signature · 1 line
2.33.0
reviewer Reviewed-by on v1 1/1
#1 lore raw

Hello Qi Xi,

Quoted 6 lines · On Thu, 4 Sep 2025 11:44:47 +0800 Qi Xi <[email protected]> wrote:

Add missing mutex unlock before returning from the error path in cdns_mhdp_atomic_enable().

Fixes 935a92a1c400 ("drm: bridge: cdns-mhdp8546: Fix possible null pointer dereference")
Signature · 3 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
reviewer Applied
#2 lore raw
In reply to Qi Xi
Quoted 4 lines · Qi Xi

Add missing mutex unlock before returning from the error path in cdns_mhdp_atomic_enable().

Applied, thanks!

[1/1] drm: bridge: cdns-mhdp8546: Fix missing mutex unlock on error path

      commit: 288dac9fb6084330d968459c750c838fd06e10e6

Best regards,

Signature · 1 line
Luca Ceresoli <[email protected]>