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 <jhugo@codeaurora.org>
Loading
Please register or sign in to comment