From: hyesoo.yu Date: Mon, 10 Jul 2017 06:40:09 +0000 (+0900) Subject: [COMMON] g2d: added fence_put() after fence is created X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5303b8206b88331e4d140bb7d97507145631b011;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] g2d: added fence_put() after fence is created The patch 8fba9cde9b815209e8f8fcd2587c85860b17ad06 hold reference to fence when creating sync_file. After fence_init and create sync_file, fence reference has increased twice, so we send the release fence after decreasing the reference because the user receiving the release fence expects the fence to increase once. Change-Id: I3091c685790ac9f05284a8c4786a6f9312a8f674 Signed-off-by: hyesoo.yu --- diff --git a/drivers/gpu/exynos/g2d/g2d_fence.c b/drivers/gpu/exynos/g2d/g2d_fence.c index 1cedcc167e66..7469dd3e74ce 100644 --- a/drivers/gpu/exynos/g2d/g2d_fence.c +++ b/drivers/gpu/exynos/g2d/g2d_fence.c @@ -170,10 +170,9 @@ struct sync_file *g2d_create_release_fence(struct g2d_device *g2d_dev, atomic_inc_return(&g2d_dev->fence_timeline)); file = sync_file_create(fence); - if (!file) { - dma_fence_put(fence); + dma_fence_put(fence); + if (!file) return ERR_PTR(-ENOMEM); - } for (i = 0; i < data->num_release_fences; i++) { release_fences[i] = get_unused_fd_flags(O_CLOEXEC);