]> git.baikalelectronics.ru Git - kernel.git/commit
android: unconditionally remove callbacks in sync_fence_free()
authorDmitry Torokhov <dtor@chromium.org>
Tue, 15 Dec 2015 01:34:08 +0000 (17:34 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Dec 2015 21:37:53 +0000 (13:37 -0800)
commita8a9e043a78d5bed1c2ff7c910b66b859773a502
tree66432e17d05e474cf963641329e9bfb5c52368f7
parent05d451754af066996c70d438d5179139757f4bc6
android: unconditionally remove callbacks in sync_fence_free()

Using fence->status to determine whether or not there are callbacks
remaining on the sync_fence is racy since fence->status may have been
decremented to 0 on another CPU before fence_check_cb_func() has
completed.  By unconditionally calling fence_remove_callback() for each
fence in the sync_fence, we guarantee that each callback has either
completed (since fence_remove_callback() grabs the fence lock) or been
removed.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/sync.c