[COMMON] g2d: added fence_put() after fence is created
authorhyesoo.yu <hyesoo.yu@samsung.com>
Mon, 10 Jul 2017 06:40:09 +0000 (15:40 +0900)
committerSeungchul Kim <sc377.kim@samsung.com>
Mon, 28 May 2018 05:27:23 +0000 (14:27 +0900)
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 <hyesoo.yu@samsung.com>
drivers/gpu/exynos/g2d/g2d_fence.c

index 1cedcc167e669b07a6a89e4f7e8cdb0340d4bbeb..7469dd3e74ce672eb2e6541df2ac548ffa2bbbf9 100644 (file)
@@ -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);