Mesa (main): lavapipe: check for error when initializing lvp_queue

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 13 20:03:52 UTC 2022


Module: Mesa
Branch: main
Commit: d3bef6ba73c600b2711a578af11f29d9f779c637
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d3bef6ba73c600b2711a578af11f29d9f779c637

Author: Greg Depoire--Ferrer <greg.depoire at gmail.com>
Date:   Fri Feb 18 01:09:18 2022 +0100

lavapipe: check for error when initializing lvp_queue

When lvp_queue_init fails, propagate the failure to the caller.

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

---

 src/gallium/frontends/lavapipe/lvp_device.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c
index 1a09b37affe..a963c38bc1d 100644
--- a/src/gallium/frontends/lavapipe/lvp_device.c
+++ b/src/gallium/frontends/lavapipe/lvp_device.c
@@ -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);
 



More information about the mesa-commit mailing list