Message ID | 20180502191700.28973-1-matthew.auld@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Quoting Matthew Auld (2018-05-02 20:17:00) > Check that the kernel rejects a zero user_size. > > Signed-off-by: Matthew Auld <matthew.auld@intel.com> > Cc: Chris Wilson <chris@chris-wilson.co.uk> Bleurgh, ugly looking test. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> -Chris
diff --git a/tests/gem_userptr_blits.c b/tests/gem_userptr_blits.c index 849054ad..7e3b6ef3 100644 --- a/tests/gem_userptr_blits.c +++ b/tests/gem_userptr_blits.c @@ -442,6 +442,14 @@ static int test_input_checking(int fd) ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr); igt_assert_neq(ret, 0); + /* Zero user_size. */ + memset(&userptr, 0, sizeof(userptr)); + userptr.user_ptr = 0; + userptr.user_size = 0; + userptr.flags = 0; + ret = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &userptr); + igt_assert_neq(ret, 0); + return 0; }
Check that the kernel rejects a zero user_size. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> --- tests/gem_userptr_blits.c | 8 ++++++++ 1 file changed, 8 insertions(+)