panfrost: Delete debug allocated syncobj.
authorVinson Lee <vlee@freedesktop.org>
Tue, 15 Sep 2020 00:53:31 +0000 (17:53 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 17 Sep 2020 23:12:14 +0000 (23:12 +0000)
Fix defect reported by Coverity Scan.

Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement: drmSyncobjDestroy(dev->fd, ...

Fixes: 64d6f56ad26f ("panfrost: Allocate syncobjs in panfrost_flush")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6720>

src/gallium/drivers/panfrost/pan_job.c

index 7db9ce9..5154a56 100644 (file)
@@ -970,7 +970,7 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch,
 
         if (!out_sync && dev->debug & (PAN_DBG_TRACE | PAN_DBG_SYNC)) {
                 drmSyncobjCreate(dev->fd, 0, &out_sync);
-                our_sync = false;
+                our_sync = true;
         }
 
         submit.out_sync = out_sync;
@@ -1003,6 +1003,9 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch,
                 if (dev->debug & PAN_DBG_MSGS)
                         fprintf(stderr, "Error submitting: %m\n");
 
+                if (our_sync)
+                        drmSyncobjDestroy(dev->fd, out_sync);
+
                 return errno;
         }