Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/gem: sanity check object size in gem_create

Depending on the regions min_page_size we might need to adjust the
object size, ensure this matches our expectations.

Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20210114182402.840247-2-matthew.auld@intel.com

authored by

Matthew Auld and committed by
Chris Wilson
7d58fef2 dcaccaf0

+2
+2
drivers/gpu/drm/i915/gem/i915_gem_create.c
··· 32 32 if (IS_ERR(obj)) 33 33 return PTR_ERR(obj); 34 34 35 + GEM_BUG_ON(size != obj->base.size); 36 + 35 37 ret = drm_gem_handle_create(file, &obj->base, &handle); 36 38 /* drop reference from allocate - handle holds it now */ 37 39 i915_gem_object_put(obj);