From: Heiko Stübner Date: Tue, 2 Jun 2015 14:41:45 +0000 (+0200) Subject: drm/rockchip: only call drm_fb_helper_hotplug_event if fb_helper present X-Git-Tag: v4.14-rc1~5028^2~2^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=765c35bbd267e93eabe15a94534688ddaa0b9dc7;p=platform%2Fkernel%2Flinux-rpi.git drm/rockchip: only call drm_fb_helper_hotplug_event if fb_helper present Add a check for the presence of fb_helper to rockchip_drm_output_poll_changed() to only call drm_fb_helper_hotplug_event if there is actually a fb_helper available. Without this check I see NULL pointer dereferences when the hdmi hotplug irq fires before the fb_helper got initialized. Signed-off-by: Heiko Stuebner --- diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c index 77d5289..002645b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c @@ -162,7 +162,8 @@ static void rockchip_drm_output_poll_changed(struct drm_device *dev) struct rockchip_drm_private *private = dev->dev_private; struct drm_fb_helper *fb_helper = &private->fbdev_helper; - drm_fb_helper_hotplug_event(fb_helper); + if (fb_helper) + drm_fb_helper_hotplug_event(fb_helper); } static const struct drm_mode_config_funcs rockchip_drm_mode_config_funcs = {