Skip to contentSkip to conversation

drm: Reject addfb2 with undefined flag bits set

PATCH New [email protected] 1 participant 1 message Nov 8, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Reject addfb2 with undefined flag bits set

From: Ville Syrjälä <[email protected]>

---
 drivers/gpu/drm/drm_crtc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/gpu/drm/drm_crtc.c +5 -0
index ef1b221..25bd64f 100644
@@ -2323,6 +2323,11 @@ int drm_mode_addfb2(struct drm_device *dev,
 	if (!drm_core_check_feature(dev, DRIVER_MODESET))
 		return -EINVAL;
 
+	if (r->flags & ~DRM_MODE_FB_INTERLACED) {
+		DRM_DEBUG_KMS("bad framebuffer flags 0x%08x\n", r->flags);
+		return -EINVAL;
+	}
+
 	if ((config->min_width > r->width) || (r->width > config->max_width)) {
 		DRM_DEBUG_KMS("bad framebuffer width %d, should be >= %d && <= %d\n",
 			  r->width, config->min_width, config->max_width);
Signature · 6 lines
1.7.8.6

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel