mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
llvmpipe: fix udmabuf mmap error check
Upon failing to mmap, MAP_FAILED (void *)-1 is returned instead of NULL. Fixes:d74ea2c117("llvmpipe: Implement dmabuf handling") Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38074> (cherry picked from commit3e07f57d4a)
This commit is contained in:
parent
ab5f1669d2
commit
fd085d2e3e
2 changed files with 2 additions and 3 deletions
|
|
@ -2874,7 +2874,7 @@
|
|||
"description": "llvmpipe: fix udmabuf mmap error check",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "d74ea2c117fe96e527471e572336f931c3c77da1",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1415,8 +1415,7 @@ llvmpipe_resource_alloc_udmabuf(struct llvmpipe_screen *screen,
|
|||
|
||||
struct pipe_memory_allocation *data =
|
||||
mmap(NULL, size, PROT_WRITE | PROT_READ, MAP_SHARED, mem_fd, 0);
|
||||
|
||||
if (!data)
|
||||
if (data == MAP_FAILED)
|
||||
goto fail;
|
||||
|
||||
alloc->mem_fd = mem_fd;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue