Browse Source

msm: eva: check on inst value from ptr_dsp2cpu

check the validity of returned inst from
ptr_dsp2cpu in func __dsp_cvp_mem_free.

Change-Id: Icb2e5721aa5f8381b76e0cc4f991c48a1d74c45e
Signed-off-by: Yu SI <[email protected]>
Yu SI 3 years ago
parent
commit
e3e3be2557
1 changed files with 6 additions and 0 deletions
  1. 6 0
      msm/eva/msm_cvp_dsp.c

+ 6 - 0
msm/eva/msm_cvp_dsp.c

@@ -1486,6 +1486,12 @@ static void __dsp_cvp_mem_free(struct cvp_dsp_cmd_msg *cmd)
 	inst = (struct msm_cvp_inst *)ptr_dsp2cpu(
 			dsp2cpu_cmd->session_cpu_high,
 			dsp2cpu_cmd->session_cpu_low);
+	if (!inst) {
+		dprintk(CVP_ERR, "%s Failed to get inst\n",
+			__func__);
+		cmd->ret = -1;
+		return;
+	}
 
 	frpc_node = cvp_find_fastrpc_node_with_handle(dsp2cpu_cmd->pid);
 	if (!frpc_node) {