lavapipe: check for error when initializing lvp_queue
authorGreg Depoire--Ferrer <greg.depoire@gmail.com>
Fri, 18 Feb 2022 00:09:18 +0000 (01:09 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 13 May 2022 19:35:11 +0000 (19:35 +0000)
When lvp_queue_init fails, propagate the failure to the caller.

Signed-off-by: Greg Depoire--Ferrer <greg.depoire@gmail.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15071>

src/gallium/frontends/lavapipe/lvp_device.c

index 1a09b37..a963c38 100644 (file)
@@ -1552,7 +1552,11 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateDevice(
    assert(pCreateInfo->queueCreateInfoCount == 1);
    assert(pCreateInfo->pQueueCreateInfos[0].queueFamilyIndex == 0);
    assert(pCreateInfo->pQueueCreateInfos[0].queueCount == 1);
-   lvp_queue_init(device, &device->queue, pCreateInfo->pQueueCreateInfos, 0);
+   result = lvp_queue_init(device, &device->queue, pCreateInfo->pQueueCreateInfos, 0);
+   if (result != VK_SUCCESS) {
+      vk_free(&device->vk.alloc, device);
+      return result;
+   }
 
    *pDevice = lvp_device_to_handle(device);