Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <gustavo.padovan@collabora.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1477515599-7685-1-git-send-email-gustavo@padovan.org

authored by

Gustavo Padovan and committed by
Sumit Semwal
4592bfcd 74881588

+1 -1
+1 -1
drivers/dma-buf/sw_sync.c
··· 316 316 } 317 317 318 318 sync_file = sync_file_create(&pt->base); 319 + dma_fence_put(&pt->base); 319 320 if (!sync_file) { 320 - dma_fence_put(&pt->base); 321 321 err = -ENOMEM; 322 322 goto err; 323 323 }