mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 15:48:36 +02:00
panfrost: do not deref potentially null pointer
We need to check for failure to import *before* we dereference here. Fixes:f94889d079("panfrost: Make pan_texture.{c,h} panfrost_bo agnostic") CID: 1587376 Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28856> (cherry picked from commit8deaf37047)
This commit is contained in:
parent
926715dcb8
commit
afb24c6612
2 changed files with 3 additions and 2 deletions
|
|
@ -1014,7 +1014,7 @@
|
|||
"description": "panfrost: do not deref potentially null pointer",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "f94889d0797f6dc66b7875e68ae7d44c0f018131",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -725,13 +725,14 @@ panfrost_resource_create_with_modifier(struct pipe_screen *screen,
|
|||
}
|
||||
assert(handle.type == WINSYS_HANDLE_TYPE_FD);
|
||||
so->bo = panfrost_bo_import(dev, handle.handle);
|
||||
so->image.data.base = so->bo->ptr.gpu;
|
||||
close(handle.handle);
|
||||
|
||||
if (!so->bo) {
|
||||
free(so);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
so->image.data.base = so->bo->ptr.gpu;
|
||||
} else {
|
||||
/* We create a BO immediately but don't bother mapping, since we don't
|
||||
* care to map e.g. FBOs which the CPU probably won't touch */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue