diff options
author | Samuel Pitoiset <[email protected]> | 2017-09-11 17:52:25 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-09-11 21:57:01 +0200 |
commit | 03542d166381ebee1404850475b7076fbd0da2c4 (patch) | |
tree | f441d042b00d52f2e88f68f755961dc6f41c4e2a /src/amd/vulkan | |
parent | fcab014f7ddfd660814bc4b4d18d25e8c0375b54 (diff) |
radv: remove unnecessary goto in radv_create_cmd_buffer()
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index c2e93d352c0..e152e56ce34 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -142,7 +142,6 @@ static VkResult radv_create_cmd_buffer( VkCommandBuffer* pCommandBuffer) { struct radv_cmd_buffer *cmd_buffer; - VkResult result; unsigned ring; cmd_buffer = vk_alloc(&pool->alloc, sizeof(*cmd_buffer), 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); @@ -171,8 +170,8 @@ static VkResult radv_create_cmd_buffer( cmd_buffer->cs = device->ws->cs_create(device->ws, ring); if (!cmd_buffer->cs) { - result = VK_ERROR_OUT_OF_HOST_MEMORY; - goto fail; + vk_free(&cmd_buffer->pool->alloc, cmd_buffer); + return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); } *pCommandBuffer = radv_cmd_buffer_to_handle(cmd_buffer); @@ -182,11 +181,6 @@ static VkResult radv_create_cmd_buffer( list_inithead(&cmd_buffer->upload.list); return VK_SUCCESS; - -fail: - vk_free(&cmd_buffer->pool->alloc, cmd_buffer); - - return result; } static void |