vulkan/wsi: Unlock before return on error path.

Fix defect reported by Coverity Scan.

Missing unlock (LOCK)
missing_unlock: Returning without unlocking wsi->wait_mutex.

Fixes: 4885e63a6d ("vulkan/wsi: implement missing wsi_register_device_event")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13698>
This commit is contained in:
Vinson Lee 2021-11-06 15:56:21 -07:00 committed by Marge Bot
parent 3a95e25e84
commit 794a9cf3d6

View file

@ -2683,8 +2683,10 @@ wsi_register_device_event(VkDevice device,
mtx_lock(&wsi->wait_mutex);
if (!wsi->hotplug_thread) {
if (pthread_create(&wsi->hotplug_thread, NULL, udev_event_listener_thread,
wsi_device))
wsi_device)) {
mtx_unlock(&wsi->wait_mutex);
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
}
mtx_unlock(&wsi->wait_mutex);
#endif