From ffbdbd631ad9aa391f5160bf50d6849d98bb6de4 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 14 Sep 2020 17:53:31 -0700 Subject: [PATCH] panfrost: Delete debug allocated syncobj. 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 Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_job.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 7db9ce936a5..5154a560048 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -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; }