All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix: drm/hisilicon: kirin_drm_crtc_init: premature of_node_put leaves crtc->port as dangling pointer
@ 2026-06-26 13:19 ` WenTao Liang
  0 siblings, 0 replies; 4+ messages in thread
From: WenTao Liang @ 2026-06-26 13:19 UTC (permalink / raw)
  To: xinliang.liu, maarten.lankhorst, mripard, tzimmermann, airlied,
	simona
  Cc: sumit.semwal, yongqin.liu, jstultz, dri-devel, linux-kernel,
	WenTao Liang, stable

of_get_child_by_name acquires a reference on the port node, but
  of_node_put is called before crtc->port is assigned. This releases the
  reference while crtc->port still holds the pointer for later use by
  drm_of_find_possible_crtcs. Fix by moving of_node_put after crtc->port
  assignment.

Cc: stable@vger.kernel.org
Fixes: 89a565dba1a0 ("drm: kirin: Move ade drm init to kirin drm drv")
Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index 8a11c2df5b88..cc453b29b22c 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -53,8 +53,8 @@ static int kirin_drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
 		DRM_ERROR("no port node found in %pOF\n", dev->dev->of_node);
 		return -EINVAL;
 	}
-	of_node_put(port);
 	crtc->port = port;
+	of_node_put(port);
 
 	ret = drm_crtc_init_with_planes(dev, crtc, plane, NULL,
 					driver_data->crtc_funcs, NULL);
-- 
2.39.5 (Apple Git-154)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-28  3:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-26 13:19 [PATCH] fix: drm/hisilicon: kirin_drm_crtc_init: premature of_node_put leaves crtc->port as dangling pointer WenTao Liang
2026-06-26 13:19 ` WenTao Liang
2026-06-26 13:30 ` sashiko-bot
2026-06-28  3:55 ` WenTao Liang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.