mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
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
This commit is contained in:
parent
dcaccaf0e8
commit
7d58fef2e7
|
|
@ -32,6 +32,8 @@ i915_gem_create(struct drm_file *file,
|
|||
if (IS_ERR(obj))
|
||||
return PTR_ERR(obj);
|
||||
|
||||
GEM_BUG_ON(size != obj->base.size);
|
||||
|
||||
ret = drm_gem_handle_create(file, &obj->base, &handle);
|
||||
/* drop reference from allocate - handle holds it now */
|
||||
i915_gem_object_put(obj);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user