DORMANTno replies

[PATCH] drm/rockchip: Fix panic on reboot when DRM device fails to bind

From: Ondřej Jirman <megi@xff.cz>
Date: 2026-07-25 12:04:12
Also in: linux-rockchip, lkml
Subsystem: arm/rockchip soc support, drm drivers, drm drivers and misc gpu patches, drm drivers for rockchip, the rest · Maintainers: Heiko Stuebner, David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Sandy Huang, Heiko Stübner, Andy Yan, Linus Torvalds

From: Ondrej Jirman <megi@xff.cz>

When DRM device is freed, we need to clear the drvdata pointer, because
it now points to invalid memory.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index 3099408e9d05..8b9992843162 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -210,6 +210,7 @@ static int rockchip_drm_bind(struct device *dev)
 	component_unbind_all(dev, drm_dev);
 err_free:
 	drm_dev_put(drm_dev);
+	dev_set_drvdata(dev, NULL);
 	return ret;
 }
 
@@ -226,6 +227,7 @@ static void rockchip_drm_unbind(struct device *dev)
 	rockchip_iommu_cleanup(drm_dev);
 
 	drm_dev_put(drm_dev);
+	dev_set_drvdata(dev, NULL);
 }
 
 DEFINE_DRM_GEM_FOPS(rockchip_drm_driver_fops);
-- 
2.54.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help