From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> mmap(2) mandates size is page aligned so check this in our wrappers. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> --- lib/i915/gem_mman.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c index 3cf9a6bbdb31..084dbb3b3678 100644 --- a/lib/i915/gem_mman.c +++ b/lib/i915/gem_mman.c @@ -57,6 +57,8 @@ void *__gem_mmap__gtt(int fd, uint32_t handle, uint64_t size, unsigned prot) struct drm_i915_gem_mmap_gtt mmap_arg; void *ptr; + igt_assert(!(size & 4095)); + memset(&mmap_arg, 0, sizeof(mmap_arg)); mmap_arg.handle = handle; if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg)) @@ -162,6 +164,8 @@ static void { struct drm_i915_gem_mmap arg; + igt_assert(!(size & 4095)); + memset(&arg, 0, sizeof(arg)); arg.handle = handle; arg.offset = offset; -- 2.19.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx