aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc_helper.c
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2009-08-31 21:39:04 -0400
committerDave Airlie <airlied@linux.ie>2009-09-02 02:28:56 -0400
commitff6fdbed8f465f796da7ab32cde67e2dfb9e1f8f (patch)
treeb0ddb81fe618d86b3f24e5906240bbb089b99fce /drivers/gpu/drm/drm_crtc_helper.c
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>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
-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 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)
842 /* If the encoder is reused for another connector, then 842 /* If the encoder is reused for another connector, then
843 * the appropriate crtc will be set later. 843 * the appropriate crtc will be set later.
844 */ 844 */
845 connector->encoder->crtc = NULL; 845 if (connector->encoder)
846 connector->encoder->crtc = NULL;
846 connector->encoder = new_encoder; 847 connector->encoder = new_encoder;
847 } 848 }
848 } 849 }