From f51d77a8b59dba874ed864de5bd359211bb8ef50 Mon Sep 17 00:00:00 2001 From: "algea.cao" Date: Tue, 2 May 2017 09:03:19 +0800 Subject: [PATCH] drm: bridge: dw-hdmi: fixup kernel crash when reboot with hdmi connected when other devices bind failed,drm will unbind and re-bind all devices. if don't cancel the delayed work but flush and destroy workqueue directly, kernel point is likely to become NULL. Change-Id: Ib48704186ee298cbd4daac1cdbbac5fb3906b6bb Signed-off-by: algea.cao --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 2e1ae88a90ba..65257044bca2 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -3879,6 +3879,13 @@ err_res: static void __dw_hdmi_remove(struct dw_hdmi *hdmi) { + if (hdmi->irq) + disable_irq(hdmi->irq); + + cancel_delayed_work(&hdmi->work); + flush_workqueue(hdmi->workqueue); + destroy_workqueue(hdmi->workqueue); + if (hdmi->audio && !IS_ERR(hdmi->audio)) platform_device_unregister(hdmi->audio); if (hdmi->hdcp_dev && !IS_ERR(hdmi->hdcp_dev))