radv/winsys: fix buffer deletion in the sysmem path
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 30 Oct 2018 10:41:19 +0000 (11:41 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 31 Oct 2018 08:21:28 +0000 (09:21 +0100)
In case we failed to submit the CS correctly.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c

index 5f621ec3fb881b0ae736ad715de604bed6da4df1..75f1c47fd903facced30fd1b436bffa6797f1125 100644 (file)
@@ -1094,10 +1094,11 @@ static int radv_amdgpu_winsys_cs_submit_sysmem(struct radeon_winsys_ctx *_ctx,
 
                for (unsigned j = 0; j < number_of_ibs; j++) {
                        ws->buffer_destroy(bos[j]);
-                       if (r)
-                               return r;
                }
 
+               if (r)
+                       return r;
+
                i += cnt;
        }
        if (fence)