Skip to content

Commit

Permalink
dma-buf/sync_file: hold reference to fence when creating sync_file
Browse files Browse the repository at this point in the history
fence referencing was out of balance. It was not taking any ref to the
fence at creating time, but it was putting a reference when freeing the
sync file.

This patch fixes the balancing issue by getting a reference for the fence
when creating the sync_file.

Signed-off-by: Gustavo Padovan <[email protected]>
Signed-off-by: Sean Paul <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
Gustavo Padovan authored and atseanpaul committed Oct 21, 2016
1 parent de1e211 commit 30cd85d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma-buf/sync_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct sync_file *sync_file_create(struct fence *fence)
if (!sync_file)
return NULL;

sync_file->fence = fence;
sync_file->fence = fence_get(fence);

snprintf(sync_file->name, sizeof(sync_file->name), "%s-%s%llu-%d",
fence->ops->get_driver_name(fence),
Expand Down

0 comments on commit 30cd85d

Please sign in to comment.