dsp: lsm: check for mem_map_handle

Sometimes adsp may fail to allocate memory for SVA calibration
data and add check if mem_map_handle is assigned with valid
non-zero handle to avoid panic.

Change-Id: Icad722edc52906e63d581aafa02b42b8518ebca6
Signed-off-by: Meng Wang <mengw@codeaurora.org>
This commit is contained in:
Meng Wang 2019-09-03 17:12:59 +08:00
commit fae3404de2

View file

@ -446,6 +446,8 @@ static int q6lsm_apr_send_pkt(struct lsm_client *client, void *handle,
if (wait)
mutex_unlock(&lsm_common.apr_lock);
if (mmap_p && *mmap_p == 0)
ret = -ENOMEM;
pr_debug("%s: leave ret %d\n", __func__, ret);
return ret;
}