CHROMIUM: android: Unconditionally remove callbacks in sync_fence_free()
authorAndrew Bresticker <abrestic@chromium.org>
Mon, 12 Oct 2015 20:31:45 +0000 (13:31 -0700)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:53:26 +0000 (13:53 -0800)
commit46dfd401fbd7b085ee104a6b714d0619c594f40c
treeebd9cd6e09bc20251b7666de3cebe3ca27190420
parent41576bbd667a912c30eb95875c06bd208b47a08e
CHROMIUM: 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.

BUG=chrome-os-partner:46382
TEST=Reboot cycle test on Smaug; no crashes seen.

Change-Id: I837180ef633aed3c5ae1e52e0d6ded838342b8fa
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/305331
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
drivers/staging/android/sync.c