[Intel-gfx] [PATCH] drm/i915: Assert internal objects are page aligned
Chris Wilson
chris at chris-wilson.co.uk
Mon Jan 16 14:52:42 UTC 2017
Internal objects must be passed a page-aligned size. Check it.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
---
drivers/gpu/drm/i915/i915_gem_internal.c | 1 +
1 file changed, 1 insertion(+)
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);
--
2.11.0
More information about the Intel-gfx
mailing list