summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_property.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2018-03-06 19:48:46 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2018-03-07 19:21:10 +0300
commit8c6c2fe2f11b0f03be34efd1639ab921c8a4c163 (patch)
treec4e468877427617cadd4f91eaa81c6d94ca8c8e1 /drivers/gpu/drm/drm_property.c
parent1371f2604dad70942041a7f1ed1a2029c67606b1 (diff)
downloadlinux-8c6c2fe2f11b0f03be34efd1639ab921c8a4c163.tar.xz
drm: WARN when trying to add enum value > 63 to a bitmask property
Enum values >63 with a bitmask property is a programmer error. WARN when someone is attempting this. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180306164849.2862-3-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_property.c')
-rw-r--r--drivers/gpu/drm/drm_property.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c
index e676b1ecc705..019d1abb94ca 100644
--- a/drivers/gpu/drm/drm_property.c
+++ b/drivers/gpu/drm/drm_property.c
@@ -386,8 +386,8 @@ int drm_property_add_enum(struct drm_property *property, int index,
* Bitmask enum properties have the additional constraint of values
* from 0 to 63
*/
- if (drm_property_type_is(property, DRM_MODE_PROP_BITMASK) &&
- (value > 63))
+ if (WARN_ON(drm_property_type_is(property, DRM_MODE_PROP_BITMASK) &&
+ value > 63))
return -EINVAL;
list_for_each_entry(prop_enum, &property->enum_list, head) {