public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Cristian Ciocaltea <cristian.ciocaltea@collabora•com>
To: "Sandy Huang" <hjc@rock-chips•com>,
	"Heiko Stübner" <heiko@sntech•de>,
	"Andy Yan" <andy.yan@rock-chips•com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux•intel.com>,
	"Maxime Ripard" <mripard@kernel•org>,
	"Thomas Zimmermann" <tzimmermann@suse•de>,
	"David Airlie" <airlied@gmail•com>,
	"Simona Vetter" <simona@ffwll•ch>,
	"Dmitry Baryshkov" <dmitry.baryshkov@oss•qualcomm.com>,
	"Dmitry Baryshkov" <lumag@kernel•org>,
	"Andrzej Hajda" <andrzej.hajda@intel•com>,
	"Neil Armstrong" <neil.armstrong@linaro•org>,
	"Robert Foss" <rfoss@kernel•org>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard•com>,
	"Jonas Karlman" <jonas@kwiboo•se>,
	"Jernej Skrabec" <jernej.skrabec@gmail•com>,
	"Luca Ceresoli" <luca.ceresoli@bootlin•com>
Cc: kernel@collabora•com, dri-devel@lists•freedesktop.org,
	 linux-arm-kernel@lists•infradead.org,
	linux-rockchip@lists•infradead.org,
	 linux-kernel@vger•kernel.org
Subject: [PATCH v4 1/3] drm/bridge: synopsys: dw-dp: Support unregistering the AUX channel
Date: Mon, 01 Jun 2026 19:13:44 +0300	[thread overview]
Message-ID: <20260601-drm-rk-fixes-v4-1-c3f3f123e1da@collabora.com> (raw)
In-Reply-To: <20260601-drm-rk-fixes-v4-0-c3f3f123e1da@collabora.com>

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")
Reviewed-by: Andy Yan <andy.yan@rock-chips•com>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora•com>
---
 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 21541be094c4..36ee6e027af5 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__ */

-- 
2.54.0



  reply	other threads:[~2026-06-01 16:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01 16:13 [PATCH v4 0/3] Rockchip DRM use-after-free & null-ptr-deref fixes Cristian Ciocaltea
2026-06-01 16:13 ` Cristian Ciocaltea [this message]
2026-06-01 16:13 ` [PATCH v4 2/3] drm/rockchip: dw_dp: Add missing newline in dev_err_probe() message Cristian Ciocaltea
2026-06-03 13:01   ` Andy Yan
2026-06-01 16:13 ` [PATCH v4 3/3] drm/rockchip: dw_dp: Release core resources Cristian Ciocaltea
2026-06-03 13:03   ` Andy Yan
2026-06-02 19:31 ` [PATCH v4 0/3] Rockchip DRM use-after-free & null-ptr-deref fixes Heiko Stuebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260601-drm-rk-fixes-v4-1-c3f3f123e1da@collabora.com \
    --to=cristian.ciocaltea@collabora$(echo .)com \
    --cc=Laurent.pinchart@ideasonboard$(echo .)com \
    --cc=airlied@gmail$(echo .)com \
    --cc=andrzej.hajda@intel$(echo .)com \
    --cc=andy.yan@rock-chips$(echo .)com \
    --cc=dmitry.baryshkov@oss$(echo .)qualcomm.com \
    --cc=dri-devel@lists$(echo .)freedesktop.org \
    --cc=heiko@sntech$(echo .)de \
    --cc=hjc@rock-chips$(echo .)com \
    --cc=jernej.skrabec@gmail$(echo .)com \
    --cc=jonas@kwiboo$(echo .)se \
    --cc=kernel@collabora$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-rockchip@lists$(echo .)infradead.org \
    --cc=luca.ceresoli@bootlin$(echo .)com \
    --cc=lumag@kernel$(echo .)org \
    --cc=maarten.lankhorst@linux$(echo .)intel.com \
    --cc=mripard@kernel$(echo .)org \
    --cc=neil.armstrong@linaro$(echo .)org \
    --cc=rfoss@kernel$(echo .)org \
    --cc=simona@ffwll$(echo .)ch \
    --cc=tzimmermann@suse$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox