summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-01-16 14:52:42 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2017-01-17 09:09:56 +0000
commitbf6b2030bed9371240127afa4a3219c78cf0119d (patch)
treeb38b4b5c37e2f8249eec1fd8b502833d8055a362 /drivers/gpu/drm/i915
parentf131e3562ef0e0aa418eeb60a8fd562c5b9b0122 (diff)
drm/i915: Assert internal objects are page aligned
Internal objects must be passed a page-aligned size. Check it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170116145242.13875-1-chris@chris-wilson.co.uk Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_internal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_internal.c b/drivers/gpu/drm/i915/i915_gem_internal.c
index 9b39472396ef..17ce53d0d092 100644
--- a/drivers/gpu/drm/i915/i915_gem_internal.c
+++ b/drivers/gpu/drm/i915/i915_gem_internal.c
@@ -156,6 +156,7 @@ i915_gem_object_create_internal(struct drm_i915_private *i915,
struct drm_i915_gem_object *obj;
GEM_BUG_ON(!size);
+ GEM_BUG_ON(!IS_ALIGNED(size, PAGE_SIZE));
if (overflows_type(size, obj->base.size))
return ERR_PTR(-E2BIG);