zink: unlock instance mutex if creation fails

avoids a deadlock

Fixes: 015eda4a41 ("zink: deduplicate VkDevice and VkInstance")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35292>
(cherry picked from commit cb6dfc4169)
This commit is contained in:
Mike Blumenkrantz 2025-06-02 13:15:06 -04:00 committed by Eric Engestrom
parent c85b640fdb
commit 7e2e576c32
2 changed files with 4 additions and 2 deletions

View file

@ -1014,7 +1014,7 @@
"description": "zink: unlock instance mutex if creation fails",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "015eda4a4186c75538a0aa915e380c5ce5863319",
"notes": null

View file

@ -3279,8 +3279,10 @@ 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)
if (!instance) {
simple_mtx_unlock(&instance_lock);
goto fail;
}
} else {
assert(instance);
}