diff mbox

[1/2] dma-buf/sync_file: hold reference to fence when creating sync_file

Message ID 1476899313-22241-1-git-send-email-gustavo@padovan.org (mailing list archive)
State New, archived
Headers show

Commit Message

Gustavo Padovan Oct. 19, 2016, 5:48 p.m. UTC
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

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 <gustavo.padovan@collabora.co.uk>
---
 drivers/dma-buf/sync_file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sean Paul Oct. 21, 2016, 2:53 p.m. UTC | #1
On Wed, Oct 19, 2016 at 1:48 PM, Gustavo Padovan <gustavo@padovan.org> wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>
> 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 <gustavo.padovan@collabora.co.uk>


Applied to drm-misc, thanks

> ---
>  drivers/dma-buf/sync_file.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
> index b29a9e8..235f8ac 100644
> --- a/drivers/dma-buf/sync_file.c
> +++ b/drivers/dma-buf/sync_file.c
> @@ -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),
> --
> 2.5.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index b29a9e8..235f8ac 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -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),