mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
freedreno/drm: don't crash for unsupported devices
For unsupported devices fd_pipe_new() will return NULL, causing a crash
when fd_device_new() tries to check device generation.
Handle fd_pipe_new() returning NULL by destroying device and returning
NULL.
Fixes: 4861067689 ("freedreno/drm: Add sub-allocator")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26961>
This commit is contained in:
parent
5a6a55fbbe
commit
7a81855a67
1 changed files with 7 additions and 0 deletions
|
|
@ -104,6 +104,9 @@ out:
|
|||
if (!use_heap) {
|
||||
struct fd_pipe *pipe = fd_pipe_new(dev, FD_PIPE_3D);
|
||||
|
||||
if (!pipe)
|
||||
goto fail;
|
||||
|
||||
/* Userspace fences don't appear to be reliable enough (missing some
|
||||
* cache flushes?) on older gens, so limit sub-alloc heaps to a6xx+
|
||||
* for now:
|
||||
|
|
@ -119,6 +122,10 @@ out:
|
|||
}
|
||||
|
||||
return dev;
|
||||
|
||||
fail:
|
||||
fd_device_del(dev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* like fd_device_new() but creates it's own private dup() of the fd
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue