From: Gustavo Padovan Date: Wed, 26 Oct 2016 20:59:59 +0000 (-0200) Subject: dma-buf/sw_sync: put fence reference from the fence creation X-Git-Tag: v4.14-rc1~1925^2~36^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4592bfcd177fe78cf9adc59f2dcddd1fa1f71079;p=platform%2Fkernel%2Flinux-rpi.git dma-buf/sw_sync: put fence reference from the fence creation Once sw_sync_ioctl_create_fence() returns we no longer have the *pt pointer to the fence base object thus we need to put the reference we have from the fence creation to keep a correct reference accounting. Signed-off-by: Gustavo Padovan Reviewed-by: Chris Wilson Signed-off-by: Sumit Semwal Link: http://patchwork.freedesktop.org/patch/msgid/1477515599-7685-1-git-send-email-gustavo@padovan.org --- diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c index 7aa4d7b..69c5ff3 100644 --- a/drivers/dma-buf/sw_sync.c +++ b/drivers/dma-buf/sw_sync.c @@ -316,8 +316,8 @@ static long sw_sync_ioctl_create_fence(struct sync_timeline *obj, } sync_file = sync_file_create(&pt->base); + dma_fence_put(&pt->base); if (!sync_file) { - dma_fence_put(&pt->base); err = -ENOMEM; goto err; }