summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2015-08-11 14:23:49 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-08-11 17:20:30 +0200
commit845249172a363c2217af5926fac17f58c7228aa4 (patch)
treec9b6f969af7eb7a024cd028f95ea1c8970d9b595
parentdrm/i915: Use CONFIG_DRM_FBDEV_EMULATION (diff)
downloadlinux-845249172a363c2217af5926fac17f58c7228aa4.tar.xz
linux-845249172a363c2217af5926fac17f58c7228aa4.zip
drm/atomic: fix null pointer access to mode_fixup callback
This patch fixes null pointer access incurred when encoder driver didn't set its own mode_fixup callback. mode_fixup callback shoudn't be called if the callback of drm_encoder_helper_funcs is NULL. Changelog v2: - change it to else if Signed-off-by: Inki Dae <inki.dae@samsung.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 0b475fae067d..96e08e940ed0 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -299,7 +299,7 @@ mode_fixup(struct drm_atomic_state *state)
encoder->base.id, encoder->name);
return ret;
}
- } else {
+ } else if (funcs->mode_fixup) {
ret = funcs->mode_fixup(encoder, &crtc_state->mode,
&crtc_state->adjusted_mode);
if (!ret) {