diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-06-20 16:26:36 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-06-24 17:08:55 +0200 |
commit | 993a80671ed9a149d5136965d04d0a71f7b21c48 (patch) | |
tree | b71090662c680bb9e6e9594c1a47b066889bb1a9 /drivers/gpu/drm/drm_modes.c | |
parent | drm: Do not use bitwise OR to set picure_aspect_ratio (diff) | |
download | linux-993a80671ed9a149d5136965d04d0a71f7b21c48.tar.xz linux-993a80671ed9a149d5136965d04d0a71f7b21c48.zip |
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: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190620142639.17518-3-ville.syrjala@linux.intel.com
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
-rw-r--r-- | drivers/gpu/drm/drm_modes.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 53acc6756ee0..847048dee048 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -1977,9 +1977,11 @@ int drm_mode_convert_umode(struct drm_device *dev, case DRM_MODE_FLAG_PIC_AR_256_135: out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135; break; - default: + case DRM_MODE_FLAG_PIC_AR_NONE: out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE; break; + default: + return -EINVAL; } out->status = drm_mode_validate_driver(dev, out); |