Commit 3b927c44 authored by Lionel Landwerlin's avatar Lionel Landwerlin Committed by Juan Suárez Romero

anv: gem-stubs: return a valid fd got anv_gem_userptr()

Fixes invalid close(-1) in the unit tests.
Signed-off-by: Lionel Landwerlin's avatarLionel Landwerlin <>
Cc: <>
Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <>
(cherry picked from commit da2d67fc)
parent 52dc974c
...@@ -68,7 +68,13 @@ anv_gem_munmap(void *p, uint64_t size) ...@@ -68,7 +68,13 @@ anv_gem_munmap(void *p, uint64_t size)
uint32_t uint32_t
anv_gem_userptr(struct anv_device *device, void *mem, size_t size) anv_gem_userptr(struct anv_device *device, void *mem, size_t size)
{ {
return -1; int fd = os_create_anonymous_file(size, "fake bo");
if (fd == -1)
return 0;
assert(fd != 0);
return fd;
} }
int int
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment