[PATCH] drm/atomic: fix null pointer access to mode_fixup callback
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Tue Aug 11 05:15:38 PDT 2015
Op 11-08-15 om 14:00 schreef Inki Dae:
> 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.
>
> Signed-off-by: Inki Dae <inki.dae at samsung.com>
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 5b59d5ad..b69469c 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -299,6 +299,9 @@ mode_fixup(struct drm_atomic_state *state)
> return ret;
> }
> } else {
> + if (!funcs->mode_fixup)
> + continue;
Change it to } else if (funcs->mode_fixup) { ?
Reviewed-By: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> ret = funcs->mode_fixup(encoder, &crtc_state->mode,
> &crtc_state->adjusted_mode);
> if (!ret) {
More information about the dri-devel
mailing list