From 3d9d9ca09b353b8d4a3628c6bfa4e800e68fd9f3 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 (cherry picked from commit 3a655c212b1b39e02cb85a11738c3c60131e3927) Part-of: --- .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 b5c310ab598..8114a67de61 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 2f994e4a1bf..297b37b3b60 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);