Skip to content

Commit

Permalink
drm/i915: Assert internal objects are page aligned
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Wilson committed Jan 17, 2017
1 parent f131e35 commit bf6b203
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/i915_gem_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bf6b203

Please sign in to comment.