Browse Source

msm: eva: Fixed static analysis error

Fix static analysis tool detected errors.

Change-Id: I882dd7aebe544b930abb49ba998c1482991a49c9
Signed-off-by: George Shen <[email protected]>
George Shen 4 years ago
parent
commit
521f3d374f
4 changed files with 8 additions and 3 deletions
  1. 1 0
      msm/eva/msm_cvp.c
  2. 5 2
      msm/eva/msm_cvp_buf.c
  3. 1 0
      msm/eva/msm_cvp_dsp.c
  4. 1 1
      msm/eva/msm_smem.c

+ 1 - 0
msm/eva/msm_cvp.c

@@ -607,6 +607,7 @@ exit:
 	dprintk(CVP_SYNX, "%s exit\n", current->comm);
 	cvp_put_inst(inst);
 	do_exit(rc);
+	return rc;
 }
 
 static int msm_cvp_session_process_hfi_fence(struct msm_cvp_inst *inst,

+ 5 - 2
msm/eva/msm_cvp_buf.c

@@ -352,12 +352,15 @@ int msm_cvp_map_buf_dsp_new(struct msm_cvp_inst *inst,
 		dprintk(CVP_WARN, "%s incorrect pid\n", __func__);
 		return -EINVAL;
 	}
-	dprintk(CVP_WARN, "%s get pid_s 0x%x from pidA 0x%x\n", __func__, pid_s, pid);
+	dprintk(CVP_DSP, "%s get pid_s 0x%x from pidA 0x%x\n", __func__, pid_s, pid);
 	/* task = get_pid_task(pid, PIDTYPE_PID); */
 	task = get_pid_task(pid_s, PIDTYPE_TGID);
 
-	if (!task)
+	if (!task) {
 		dprintk(CVP_WARN, "%s task doesn't exist\n", __func__);
+		return -EINVAL;
+	}
+
 	file = msm_cvp_fget(buf->fd, task, FMODE_PATH, 1);
 	if (file == NULL) {
 		dprintk(CVP_WARN, "%s fail to get file from fd\n", __func__);

+ 1 - 0
msm/eva/msm_cvp_dsp.c

@@ -1838,6 +1838,7 @@ wait_dsp:
 exit:
 	dprintk(CVP_DBG, "dsp thread exit\n");
 	do_exit(rc);
+	return rc;
 }
 
 int cvp_dsp_device_init(void)

+ 1 - 1
msm/eva/msm_smem.c

@@ -256,7 +256,7 @@ static int alloc_dma_mem(size_t size, u32 align, int map_kernel,
 	dma_addr_t iova = 0;
 	int rc = 0;
 	struct dma_buf *dbuf = NULL;
-	struct dma_heap *heap;
+	struct dma_heap *heap = NULL;
 
 	if (!res) {
 		dprintk(CVP_ERR, "%s: NULL res\n", __func__);