summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2017-04-28 18:08:53 +0200
committerRobert Foss <robert.foss@collabora.com>2017-05-04 09:42:48 -0400
commit6f64d4d5cddc2fb7d80eb10dbaa482244cf62e8c (patch)
tree134411e1b0d8a18c839ab0f8052bb58535c0a64b
parent135cacc50156ac266bdfac271519961dcf30b3dc (diff)
downloadlinux-imx_rdu2_v4.11-rc3.tar.gz
linux-imx_rdu2_v4.11-rc3.tar.xz
drm/etnaviv: don't put fence in case of submit failureimx_rdu2_v4.11-rc3
If we bail out of the submit before actually adding the cmdstream to the kernel ring there is no valid fence to put. Make sure to skip the fence_put in that case. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
index e190942..de80ee1 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
@@ -44,6 +44,7 @@ static struct etnaviv_gem_submit *submit_create(struct drm_device *dev,
/* initially, until copy_from_user() and bo lookup succeeds: */
submit->nr_bos = 0;
+ submit->fence = NULL;
ww_acquire_init(&submit->ticket, &reservation_ww_class);
}
@@ -294,7 +295,8 @@ static void submit_cleanup(struct etnaviv_gem_submit *submit)
}
ww_acquire_fini(&submit->ticket);
- dma_fence_put(submit->fence);
+ if (submit->fence)
+ dma_fence_put(submit->fence);
kfree(submit);
}