From 395c23946b44b071cc376f488a3205bedb02b382 Mon Sep 17 00:00:00 2001 From: Matthew Auld Date: Wed, 9 May 2018 12:43:55 +0100 Subject: tests/gem_userptr_blits: test zero user_size Check that the kernel rejects a zero user_size. Signed-off-by: Matthew Auld Cc: Chris Wilson Reviewed-by: Chris Wilson --- tests/gem_userptr_blits.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') 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; } -- cgit v1.2.3