llvmpipe: zero is also a valid fd

Fixes: a062544d3d ("llvmpipe: Use an anonymous file for memory allocations")
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
(cherry picked from commit 3a655c212b)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38432>
This commit is contained in:
Yiwei Zhang 2025-10-26 18:12:05 -07:00 committed by Dylan Baker
parent e817b525d8
commit 3d9d9ca09b
2 changed files with 2 additions and 2 deletions

View file

@ -1694,7 +1694,7 @@
"description": "llvmpipe: zero is also a valid fd",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "a062544d3d0519aaa3845b7cfd79e925b9352a55",
"notes": null

View file

@ -1357,7 +1357,7 @@ llvmpipe_free_memory(struct pipe_screen *pscreen,
#if DETECT_OS_LINUX
struct llvmpipe_screen *screen = llvmpipe_screen(pscreen);
if (mem->fd) {
if (mem->fd >= 0) {
mtx_lock(&screen->mem_mutex);
util_vma_heap_free(&screen->mem_heap, mem->offset, mem->size);
mtx_unlock(&screen->mem_mutex);