From ab5f1669d2af251b3b0990924a1ef5176b675c57 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Sun, 26 Oct 2025 18:12:05 -0700 Subject: [PATCH] llvmpipe: zero is also a valid fd Fixes: a062544d3d0 ("llvmpipe: Use an anonymous file for memory allocations") Reviewed-by: Christian Gmeiner Part-of: (cherry picked from commit 3a655c212b1b39e02cb85a11738c3c60131e3927) --- .pick_status.json | 2 +- src/gallium/drivers/llvmpipe/lp_texture.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 6871c187ada..f7596e66b75 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2884,7 +2884,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 diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index f1f1baa6db4..91355060ea5 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -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);