From cde5b86a88c42c0139c0d685bd9844a7cee5dc4d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 17 Sep 2020 16:08:41 -0700 Subject: [PATCH] turnip: Release bo_mutex lock before potential error path. Fix defect reported by Coverity Scan. Missing unlock (LOCK) missing_unlock: Returning without unlocking queue->device->bo_mutex. Suggested-by: Jonathan Marek Fixes: bea6290ca090 ("turnip: device global bo list") Signed-off-by: Vinson Lee Part-of: --- src/freedreno/vulkan/tu_drm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/freedreno/vulkan/tu_drm.c b/src/freedreno/vulkan/tu_drm.c index fb3bb194338..ca1403fd4b9 100644 --- a/src/freedreno/vulkan/tu_drm.c +++ b/src/freedreno/vulkan/tu_drm.c @@ -746,13 +746,12 @@ tu_QueueSubmit(VkQueue _queue, int ret = drmCommandWriteRead(queue->device->physical_device->local_fd, DRM_MSM_GEM_SUBMIT, &req, sizeof(req)); + mtx_unlock(&queue->device->bo_mutex); if (ret) { return tu_device_set_lost(queue->device, "submit failed: %s\n", strerror(errno)); } - mtx_unlock(&queue->device->bo_mutex); - tu_semaphores_remove_temp(queue->device, pSubmits[i].pWaitSemaphores, pSubmits[i].waitSemaphoreCount); if (last_submit) {