mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +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>
This commit is contained in:
parent
186f7fa915
commit
8deaf37047
1 changed files with 2 additions and 1 deletions
|
|
@ -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