aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/android/sync.c
diff options
context:
space:
mode:
authorErik Gilling <konkers@android.com>2013-02-28 16:43:08 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-04 17:44:07 +0800
commitcc3c5cdc7bc16b78b6c59f0720542965a67d1c81 (patch)
tree748ddfd4f71873c97b73d5952c155bf1ac2f6056 /drivers/staging/android/sync.c
parent6e91f719865df97abf483b80b7778dc8a51011c4 (diff)
staging: sync: Reorder sync_fence_release
Previously fence's pts were freed before the were the fence was removed from the global fence list. This led to a race with the debugfs support where it would iterate over sync_pts that had been freed. Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Cc: Erik Gilling <konkers@android.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Clark <robclark@gmail.com> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Erik Gilling <konkers@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/sync.c')
-rw-r--r--drivers/staging/android/sync.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 6739a8440bf..2afbd69ab9f 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -520,12 +520,12 @@ static int sync_fence_release(struct inode *inode, struct file *file)
struct sync_fence *fence = file->private_data;
unsigned long flags;
- sync_fence_free_pts(fence);
-
spin_lock_irqsave(&sync_fence_list_lock, flags);
list_del(&fence->sync_fence_list);
spin_unlock_irqrestore(&sync_fence_list_lock, flags);
+ sync_fence_free_pts(fence);
+
kfree(fence);
return 0;