From f3bb4cdf7b6867e72f4d0d82429d68bbdc1530d1 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 17 Jan 2017 10:28:56 +0200 Subject: [PATCH] UPSTREAM: drm: bridge: dw-hdmi: Don't forward HPD events to DRM core before attach Hotplug events should only be forwarded to the DRM core by the interrupt handler when the bridge has been attached, otherwise the DRM device pointer will be NULL, resulting in a crash. Signed-off-by: Laurent Pinchart Reviewed-by: Jose Abreu Signed-off-by: Archit Taneja Link: http://patchwork.freedesktop.org/patch/msgid/20170117082910.27023-7-laurent.pinchart+renesas@ideasonboard.com Change-Id: Ic1387b5253d4586774cdb82e089effdd4104e380 Signed-off-by: Zheng Yang (cherry pick from ba5d7e6160b7aed4df92d1764aa90790db0e7996) --- drivers/gpu/drm/bridge/dw-hdmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c index 3ec4d712c5b8..99d51b21d077 100644 --- a/drivers/gpu/drm/bridge/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/dw-hdmi.c @@ -291,7 +291,8 @@ static void repo_hpd_event(struct work_struct *p_work) { struct dw_hdmi *hdmi = container_of(p_work, struct dw_hdmi, work.work); - drm_helper_hpd_irq_event(hdmi->bridge.dev); + if (hdmi->bridge.dev) + drm_helper_hpd_irq_event(hdmi->bridge.dev); #ifdef CONFIG_SWITCH if (hdmi->hpd_state) switch_set_state(&hdmi->switchdev, 1); -- 2.34.1