summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-10-15 14:58:56 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-10-19 11:13:20 +0100
commitef6e4fbd13d7829b844bd318cbf9c51b0fa41792 (patch)
tree1b724be0477dc4ef4cd8024fa5f3edc3ad586589 /lib
parentabe63173a1e6edad1253c0c4009ae3c6c0eb384b (diff)
lib: Make dummyload less sensitive to abusive users
If the user wants to keep the handle alive after igt_spin is freed, let them take ownership! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_dummyload.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 65b5cc92..6060878d 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -450,7 +450,8 @@ void igt_spin_free(int fd, igt_spin_t *spin)
gem_close(fd, spin->poll_handle);
}
- gem_close(fd, spin->handle);
+ if (spin->handle)
+ gem_close(fd, spin->handle);
if (spin->out_fence >= 0)
close(spin->out_fence);