summaryrefslogtreecommitdiffstats
path: root/drivers/dma-buf/sync_file.c
diff options
context:
space:
mode:
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>2016-09-21 09:20:19 +0200
committerSean Paul <seanpaul@chromium.org>2016-09-22 13:06:16 +0200
commitc654dd07522e88bacc546c9ccd81b3ee72838ccf (patch)
tree46dbb5210cabf230700cab1b458abff2fc8b8377 /drivers/dma-buf/sync_file.c
parentdrm/i2c: tda998x: don't register the connector (diff)
downloadlinux-c654dd07522e88bacc546c9ccd81b3ee72838ccf.tar.xz
linux-c654dd07522e88bacc546c9ccd81b3ee72838ccf.zip
dma-buf/sync_file: free fences array in num_fences is 1
When merging sync_files there is a case when we can end up with only one fence in the merged sync_file: when all fences belong to the same timeline. So for this case a fence_array is not created instead we just assigned the fence to sync_file->fence. Then we do not use the fences array anymore nor does free it. This patch frees the array. Reported-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1474442419-6040-1-git-send-email-gustavo@padovan.org
Diffstat (limited to 'drivers/dma-buf/sync_file.c')
-rw-r--r--drivers/dma-buf/sync_file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index 0fe7ec2657fd..b29a9e817320 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -150,6 +150,7 @@ static int sync_file_set_fence(struct sync_file *sync_file,
*/
if (num_fences == 1) {
sync_file->fence = fences[0];
+ kfree(fences);
} else {
array = fence_array_create(num_fences, fences,
fence_context_alloc(1), 1, false);