From: Erik Gilling Date: Thu, 12 Jul 2012 00:07:39 +0000 (-0700) Subject: sync: reorder sync_fence_release X-Git-Tag: firefly_0821_release~7568 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7b6920244ba00df0d82da8dffae6c3d588f3a705;p=firefly-linux-kernel-4.4.55.git 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. Change-Id: Ia3ddbf77de42ca593fc2dc353b5d04e42ddf3946 Signed-off-by: Erik Gilling --- diff --git a/drivers/base/sync.c b/drivers/base/sync.c index 0fcc720557e6..f85a1c5502a0 100644 --- a/drivers/base/sync.c +++ b/drivers/base/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;