UPSTREAM: 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>

Bug: None
Patchset: staging-android-sync

(cherry-picked from 699f685569434510d944e419f4048c4e3ba8d631)
Signed-off-by: Mattias Nissler <mnissler@google.com>
Change-Id: I824cd6623ab3222faace25c06d0e1473c0f3e7c0
1 file changed