From ff6fdbed8f465f796da7ab32cde67e2dfb9e1f8f Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Tue, 1 Sep 2009 03:39:04 +0200 Subject: drm/crtc_helper: avoid NULL-pointer dereference when encoder is NULL Signed-off-by: Maarten Maathuis Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_crtc_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index db0237dec6c..e7e6c25b560 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; } } -- cgit v1.2.3