diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-10-15 14:58:56 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-10-19 11:13:20 +0100 |
commit | ef6e4fbd13d7829b844bd318cbf9c51b0fa41792 (patch) | |
tree | 1b724be0477dc4ef4cd8024fa5f3edc3ad586589 | |
parent | abe63173a1e6edad1253c0c4009ae3c6c0eb384b (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>
-rw-r--r-- | lib/igt_dummyload.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c index 65b5cc927..6060878dd 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); |