summaryrefslogtreecommitdiff
path: root/drivers/dma-buf/sw_sync.c
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2019-12-19 00:14:33 -0300
committerGitHub <noreply@github.com>2019-12-19 00:14:33 -0300
commitfa8a03bec68d9ef89da72277bd3501ed3daa6217 (patch)
tree3d3218332bcb34cb0afa01d6ad996058a3dbcb77 /drivers/dma-buf/sw_sync.c
parent6b774eec1f9d3064e9b33634dfa99d5666d0a73a (diff)
parent1ddf624b0b268fdc0b80b1de618b98f8d117afea (diff)
Merge pull request #55 from toradex/4.14-2.0.x-imx
4.14 2.0.x imx
Diffstat (limited to 'drivers/dma-buf/sw_sync.c')
-rw-r--r--drivers/dma-buf/sw_sync.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
index 24f83f9eeaed..114b36674af4 100644
--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -141,17 +141,14 @@ static void timeline_fence_release(struct dma_fence *fence)
{
struct sync_pt *pt = dma_fence_to_sync_pt(fence);
struct sync_timeline *parent = dma_fence_parent(fence);
+ unsigned long flags;
+ spin_lock_irqsave(fence->lock, flags);
if (!list_empty(&pt->link)) {
- unsigned long flags;
-
- spin_lock_irqsave(fence->lock, flags);
- if (!list_empty(&pt->link)) {
- list_del(&pt->link);
- rb_erase(&pt->node, &parent->pt_tree);
- }
- spin_unlock_irqrestore(fence->lock, flags);
+ list_del(&pt->link);
+ rb_erase(&pt->node, &parent->pt_tree);
}
+ spin_unlock_irqrestore(fence->lock, flags);
sync_timeline_put(parent);
dma_fence_free(fence);
@@ -275,7 +272,8 @@ static struct sync_pt *sync_pt_create(struct sync_timeline *obj,
p = &parent->rb_left;
} else {
if (dma_fence_get_rcu(&other->base)) {
- dma_fence_put(&pt->base);
+ sync_timeline_put(obj);
+ kfree(pt);
pt = other;
goto unlock;
}