Skip to contentSkip to conversation

android: fix reference leak in sync_fence_create

PATCH New Maarten Lankhorst 1 participant 1 message Sep 1, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 android: fix reference leak in sync_fence_create

According to the documentation sync_fence_create takes ownership of the point, not a reference on the point.

This fixes a memory leak introduced in 3.17's android fence rework.

Cc Colin Cross <[email protected]>
Cc Dan Carpenter <[email protected]>
---
 drivers/staging/android/sync.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/android/sync.c +0 -1
index e7b2e0234196..69139ce7420d 100644
@@ -199,7 +199,6 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt)
 	fence->num_fences = 1;
 	atomic_set(&fence->status, 1);
 
-	fence_get(&pt->base);
 	fence->cbs[0].sync_pt = &pt->base;
 	fence->cbs[0].fence = fence;
 	if (fence_add_callback(&pt->base, &fence->cbs[0].cb,
Signature · 1 line
2.0.4