Skip to contentSkip to conversation

dma-buf/sw_sync: put fence reference from the fence creation

PATCH Applied Gustavo Padovan 3 participants 3 messages Oct 26, 2016 – Nov 8, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma-buf/sw_sync: put fence reference from the fence creation

From: Gustavo Padovan <[email protected]>

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.

---
 drivers/dma-buf/sw_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma-buf/sw_sync.c +1 -1
index 82e0ca4..efed2b7 100644
@@ -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;
 	}
Signature · 6 lines
2.5.5

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

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.

Fixes 30cd85dd6edc ("dma-buf/sync_file: hold reference to fence when creating sync_file")

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Applied
#2 lore raw
Quoted 12 lines · Chris Wilson
Quoted 7 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

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.

Fixes 30cd85dd6edc ("dma-buf/sync_file: hold reference to fence when creating sync_file")

-Chris

Applied to drm-misc; Thanks!

Quoted 6 lines

--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel