llvmpipe: add a missing alloc error handling in fd import

Fixes: d74ea2c117 ("llvmpipe: Implement dmabuf handling")
Suggested-by: Christian Gmeiner <cgmeiner@igalia.com>
(cherry picked from commit 66414c6b70)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38432>
This commit is contained in:
Yiwei Zhang 2025-10-30 19:27:48 -07:00 committed by Dylan Baker
parent 36aff3454b
commit eface4be0d
2 changed files with 4 additions and 1 deletions

View file

@ -1674,7 +1674,7 @@
"description": "llvmpipe: add a missing alloc error handling in fd import",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "d74ea2c117fe96e527471e572336f931c3c77da1",
"notes": null

View file

@ -1485,6 +1485,9 @@ llvmpipe_import_memory_fd(struct pipe_screen *screen,
bool dmabuf)
{
struct llvmpipe_memory_allocation *alloc = CALLOC_STRUCT(llvmpipe_memory_allocation);
if (!alloc)
return false;
alloc->mem_fd = -1;
alloc->dmabuf_fd = -1;
#if defined(HAVE_LIBDRM) && defined(HAVE_LINUX_UDMABUF_H)