aboutsummaryrefslogtreecommitdiff
path: root/drivers/base/sync.c
diff options
context:
space:
mode:
authorLorDClockaN <davor@losinj.com>2014-06-18 15:09:32 +0200
committerLorDClockaN <davor@losinj.com>2014-06-18 15:09:32 +0200
commit3d258ae906ee28e8f43f1fe1f51d48a63b5fd1ca (patch)
treedaf27e2d6c97a18c9525ec3207a6aa6191165a2d /drivers/base/sync.c
parent69a8edcfd8ca6987626f20cd5a78051f43f532e9 (diff)
parentc795f63b44d1f605b84261bd9a76e53f6f1a0b7d (diff)
Merge branch 'kitkat' of https://github.com/AOKP/kernel_lge_mako into 443HEADkitkat
Change-Id: I1801401160f3216c9e2621b4cb337b3c11d82c9e
Diffstat (limited to 'drivers/base/sync.c')
-rw-r--r--drivers/base/sync.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/base/sync.c b/drivers/base/sync.c
index 2e359968919..95819987fbe 100644
--- a/drivers/base/sync.c
+++ b/drivers/base/sync.c
@@ -79,27 +79,27 @@ static void sync_timeline_free(struct kref *kref)
container_of(kref, struct sync_timeline, kref);
unsigned long flags;
- if (obj->ops->release_obj)
- obj->ops->release_obj(obj);
-
spin_lock_irqsave(&sync_timeline_list_lock, flags);
list_del(&obj->sync_timeline_list);
spin_unlock_irqrestore(&sync_timeline_list_lock, flags);
+ if (obj->ops->release_obj)
+ obj->ops->release_obj(obj);
+
kfree(obj);
}
void sync_timeline_destroy(struct sync_timeline *obj)
{
obj->destroyed = true;
+ smp_wmb();
/*
- * If this is not the last reference, signal any children
- * that their parent is going away.
+ * signal any children that their parent is going away.
*/
+ sync_timeline_signal(obj);
- if (!kref_put(&obj->kref, sync_timeline_free))
- sync_timeline_signal(obj);
+ kref_put(&obj->kref, sync_timeline_free);
}
EXPORT_SYMBOL(sync_timeline_destroy);