From: Thomas Wood Date: Fri, 29 Nov 2013 15:33:26 +0000 (+0000) Subject: drm/edid: fix length check when adding extra 3D modes X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7d14b95f1a3bb20bf7ad977b9268c5d1639156e2;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/edid: fix length check when adding extra 3D modes Signed-off-by: Thomas Wood Reviewed-by: Ville Syrjälä Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index fb7cf0e796f6..381c698e8a3e 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -2674,7 +2674,7 @@ static int add_3d_struct_modes(struct drm_connector *connector, u16 structure, int modes = 0; u8 cea_mode; - if (video_db == NULL || video_index > video_len) + if (video_db == NULL || video_index >= video_len) return 0; /* CEA modes are numbered 1..127 */