Thread (8 messages) 8 messages, 3 authors, 2026-06-01

Re: [PATCH v3 1/2] drm/bridge: synopsys: dw-dp: Support unregistering the AUX channel

From: Andy Yan <andy.yan@rock-chips.com>
Date: 2026-05-31 10:32:35
Also in: dri-devel, linux-rockchip, lkml

Hello,

On 3/27/26 08:55, Cristian Ciocaltea wrote:
The DisplayPort AUX channel gets initialized and registered during
dw_dp_bind(), but it is never unregistered, which may lead to resource
leaks and/or use-after-free.

Add the missing dw_dp_unbind() function to allow the users of the
library to handle the required cleanup, i.e. unregister the AUX adapter.

Fixes: 86eecc3a9c2e ("drm/bridge: synopsys: Add DW DPTX Controller support library")
Signed-off-by: Cristian Ciocaltea <redacted>
    Reviewed-by: Andy Yan [off-list ref]

Thanks.
quoted hunk ↗ jump to hunk
---
  drivers/gpu/drm/bridge/synopsys/dw-dp.c | 6 ++++++
  include/drm/bridge/dw_dp.h              | 1 +
  2 files changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
index 3f4530c117c7..6211ba6ba7bd 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
@@ -2093,6 +2093,12 @@ struct dw_dp *dw_dp_bind(struct device *dev, struct drm_encoder *encoder,
  }
  EXPORT_SYMBOL_GPL(dw_dp_bind);
  
+void dw_dp_unbind(struct dw_dp *dp)
+{
+	drm_dp_aux_unregister(&dp->aux);
+}
+EXPORT_SYMBOL_GPL(dw_dp_unbind);
+
  MODULE_AUTHOR("Andy Yan <andyshrk@163.com>");
  MODULE_DESCRIPTION("DW DP Core Library");
  MODULE_LICENSE("GPL");
diff --git a/include/drm/bridge/dw_dp.h b/include/drm/bridge/dw_dp.h
index 25363541e69d..22105c3e8e4d 100644
--- a/include/drm/bridge/dw_dp.h
+++ b/include/drm/bridge/dw_dp.h
@@ -24,4 +24,5 @@ struct dw_dp_plat_data {
  
  struct dw_dp *dw_dp_bind(struct device *dev, struct drm_encoder *encoder,
  			 const struct dw_dp_plat_data *plat_data);
+void dw_dp_unbind(struct dw_dp *dp);
  #endif /* __DW_DP__ */
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help