comp: Fix vk_deinit_mutex asserts when vk_create_device fails.

This commit is contained in:
Meng Jiao 2024-05-20 11:23:14 +08:00 committed by Simon Zeni
parent 129f8ff1b6
commit 48f63f7f60

View file

@ -282,6 +282,12 @@ create_device(struct vk_bundle *vk, const struct comp_vulkan_arguments *vk_args)
.synchronization_2 = true,
};
ret = vk_init_mutex(vk);
if (ret != VK_SUCCESS) {
VK_ERROR_RET(vk, "vk_init_mutex", "Failed to init mutex.", ret);
return ret;
}
// No other way then to try to see if realtime is available.
for (size_t i = 0; i < ARRAY_SIZE(prios); i++) {
ret = vk_create_device( //
@ -316,12 +322,6 @@ create_device(struct vk_bundle *vk, const struct comp_vulkan_arguments *vk_args)
return ret;
}
ret = vk_init_mutex(vk);
if (ret != VK_SUCCESS) {
VK_ERROR_RET(vk, "vk_init_mutex", "Failed to init mutex.", ret);
return ret;
}
// Print device information.
vk_print_opened_device_info(vk, U_LOGGING_INFO);