msm: kgsl: Protect the event->handle with spinlock

event->handle pointer can be used after free due to
the race condition between kgsl_sync_callback and
kgsl_sync_fence_async_cancel.

Protect the event->handle with a spinlock to
avoid concurrent access issues.

Backported security patch from 3.10. Locking in
kgsl_cmdbatch_add_sync_fence is moved further inwards
which is safe because refcount meant to protect list
entries is atomically incremented before the event is
added to the list and atomically decremented after
lock is released.

FPIIM-1958

Change-Id: I3719e401af9ece82ac68b72f2aef784c7fdc1104
Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
1 file changed