From: Maarten Maathuis Date: Tue, 1 Sep 2009 01:39:04 +0000 (+0200) Subject: drm/crtc_helper: avoid NULL-pointer dereference when encoder is NULL X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ff6fdbed8f465f796da7ab32cde67e2dfb9e1f8f;p=linux-beck.git drm/crtc_helper: avoid NULL-pointer dereference when encoder is NULL Signed-off-by: Maarten Maathuis Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index db0237dec6c4..e7e6c25b560c 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -842,7 +842,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) /* If the encoder is reused for another connector, then * the appropriate crtc will be set later. */ - connector->encoder->crtc = NULL; + if (connector->encoder) + connector->encoder->crtc = NULL; connector->encoder = new_encoder; } }