[PATCH i-g-t 2/4] lib/intel_allocator: do not fail if no allocator on close

Kamil Konieczny kamil.konieczny at linux.intel.com
Wed Jan 26 17:48:28 UTC 2022


Do not fail when client happens to close some stale handles
but there are no allocator for it (some other close or init
happens in between).

Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
---
 lib/intel_allocator.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/intel_allocator.c b/lib/intel_allocator.c
index eabff1f9..91082ffa 100644
--- a/lib/intel_allocator.c
+++ b/lib/intel_allocator.c
@@ -465,6 +465,10 @@ static int handle_request(struct alloc_req *req, struct alloc_resp *resp)
 			pthread_mutex_lock(&map_mutex);
 			al = __allocator_find_by_handle(req->allocator_handle);
 			pthread_mutex_unlock(&map_mutex);
+			if (!al && req->request_type == REQ_FREE) {
+				resp->response_type = RESP_FREE;
+				return 0;
+			}
 			igt_assert(al);
 
 			ial = al->ial;
-- 
2.32.0



More information about the Intel-gfx-trybot mailing list