[PATCH 2/2] drm/bridge: th1520-dw-hdmi: Fix remove() callback

Felix Gu posted 2 patches 2 weeks, 2 days ago
[PATCH 2/2] drm/bridge: th1520-dw-hdmi: Fix remove() callback
Posted by Felix Gu 2 weeks, 2 days ago
This driver stores struct th1520_hdmi * in platform drvdata, but
th1520_dw_hdmi_remove() was reading it back as struct dw_hdmi *
and passing it to dw_hdmi_remove(), so teardown runs on the wrong
pointer.

Retrieve struct th1520_hdmi * from platform drvdata and pass
hdmi->dw_hdmi to dw_hdmi_remove().

Fixes: 96f30ee0fb9d ("drm/bridge: add a driver for T-Head TH1520 HDMI controller")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
---
 drivers/gpu/drm/bridge/th1520-dw-hdmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/bridge/th1520-dw-hdmi.c b/drivers/gpu/drm/bridge/th1520-dw-hdmi.c
index c9968ec1823c..6ec9003a8f3f 100644
--- a/drivers/gpu/drm/bridge/th1520-dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/th1520-dw-hdmi.c
@@ -146,9 +146,9 @@ static int th1520_dw_hdmi_probe(struct platform_device *pdev)
 
 static void th1520_dw_hdmi_remove(struct platform_device *pdev)
 {
-	struct dw_hdmi *hdmi = platform_get_drvdata(pdev);
+	struct th1520_hdmi *hdmi = platform_get_drvdata(pdev);
 
-	dw_hdmi_remove(hdmi);
+	dw_hdmi_remove(hdmi->dw_hdmi);
 }
 
 static const struct of_device_id th1520_dw_hdmi_of_table[] = {

-- 
2.43.0
Re: [PATCH 2/2] drm/bridge: th1520-dw-hdmi: Fix remove() callback
Posted by Dmitry Baryshkov 2 weeks ago
On Sat, Mar 21, 2026 at 03:12:11AM +0800, Felix Gu wrote:
> This driver stores struct th1520_hdmi * in platform drvdata, but
> th1520_dw_hdmi_remove() was reading it back as struct dw_hdmi *
> and passing it to dw_hdmi_remove(), so teardown runs on the wrong
> pointer.
> 
> Retrieve struct th1520_hdmi * from platform drvdata and pass
> hdmi->dw_hdmi to dw_hdmi_remove().
> 
> Fixes: 96f30ee0fb9d ("drm/bridge: add a driver for T-Head TH1520 HDMI controller")
> Signed-off-by: Felix Gu <ustc.gu@gmail.com>
> ---
>  drivers/gpu/drm/bridge/th1520-dw-hdmi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


-- 
With best wishes
Dmitry