summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2009-09-01 03:39:04 +0200
committerDave Airlie <airlied@linux.ie>2009-09-02 16:28:56 +1000
commitff6fdbed8f465f796da7ab32cde67e2dfb9e1f8f (patch)
treeb0ddb81fe618d86b3f24e5906240bbb089b99fce
parent9c552dd79346f86a3b53e41255c92c6f560b80fb (diff)
drm/crtc_helper: avoid NULL-pointer dereference when encoder is NULL
Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c3
1 files changed, 2 insertions, 1 deletions
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;
}
}