From: Inki Dae Date: Tue, 11 Aug 2015 12:23:49 +0000 (+0900) Subject: drm/atomic: fix null pointer access to mode_fixup callback X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=845249172a363c2217af5926fac17f58c7228aa4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Maarten Lankhorst Signed-off-by: Daniel Vetter --- 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) {