Commit 993a8067 authored by Ville Syrjälä's avatar Ville Syrjälä

drm: Do not accept garbage mode aspect ratio flags

Don't let userspace feed us any old garbage in the mode aspect ratio
flags.

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190620142639.17518-3-ville.syrjala@linux.intel.comReviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 700710e9
...@@ -1977,9 +1977,11 @@ int drm_mode_convert_umode(struct drm_device *dev, ...@@ -1977,9 +1977,11 @@ int drm_mode_convert_umode(struct drm_device *dev,
case DRM_MODE_FLAG_PIC_AR_256_135: case DRM_MODE_FLAG_PIC_AR_256_135:
out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135; out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135;
break; break;
default: case DRM_MODE_FLAG_PIC_AR_NONE:
out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE; out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
break; break;
default:
return -EINVAL;
} }
out->status = drm_mode_validate_driver(dev, out); out->status = drm_mode_validate_driver(dev, out);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment