mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
zink: Handle null instance in 2nd create_screen
If zink_internal_create_screen is called twice and the first call fails
with instance==NULL, then the second call also needs to goto fail
instead of just asserting that instance is non-null.
Fixes: 015eda4a ("zink: deduplicate VkDevice and VkInstance")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13337
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35518>
This commit is contained in:
parent
6d8bc4c98a
commit
7d974c32ce
1 changed files with 7 additions and 6 deletions
|
|
@ -3279,12 +3279,13 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
if (++instance_refcount == 1) {
|
||||
instance_info.loader_version = zink_get_loader_version(screen);
|
||||
instance = zink_create_instance(screen, &instance_info);
|
||||
if (!instance) {
|
||||
simple_mtx_unlock(&instance_lock);
|
||||
goto fail;
|
||||
}
|
||||
} else {
|
||||
assert(instance);
|
||||
}
|
||||
if (!instance) {
|
||||
/* We don't decrement instance_refcount here. This prevents us from trying
|
||||
* to create another instance on subsequent calls.
|
||||
*/
|
||||
simple_mtx_unlock(&instance_lock);
|
||||
goto fail;
|
||||
}
|
||||
screen->instance = instance;
|
||||
screen->instance_info = &instance_info;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue