msm: smem: init remote spinlocks before handing out reference
msm: smem: init remote spinlocks before handing out reference

The private API smem_get_remote_spinlock() is used by related modules to
get a reference to the remote spinlock for the purposes of unit testing.
smem_get_remote_spinlock() does not check to see if the spinlock is
initialized before handing out the reference, which could cause a crash
if the API is called before the spinlock is initialized.

Fix these possible crashes by checking if the spinlock is initialized
before handing out the reference.  If the check fails, initialize the
spinlock before returning the reference.

Change-Id: Ib407f5123cb540d58cef9260c8ebb9b81219c6d6
Signed-off-by: Jeffrey Hugo <818337a29cd9de0a36216deae1fd60ff7b0ab832@codeaurora.org>

TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas