Parcourir la source

Merge "msm: adsprpc: adding proper null check." into dsp-kernel.lnx.1.0

Tharun Kumar Merugu il y a 2 ans
Parent
commit
ff4c4832be
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      dsp/adsprpc.c

+ 4 - 1
dsp/adsprpc.c

@@ -4038,6 +4038,8 @@ static int fastrpc_init_create_static_process(struct fastrpc_file *fl,
 
 			VERIFY(err, NULL != (dst_perms = kcalloc(rhvm->vmcount,
 						sizeof(struct qcom_scm_vmperm), GFP_KERNEL)));
+			if (err)
+				goto bail;
 			for (i = 0; i < rhvm->vmcount; i++) {
 				dst_perms[i].vmid = rhvm->vmid[i];
 				dst_perms[i].perm = rhvm->vmperm[i];
@@ -4676,7 +4678,8 @@ static int fastrpc_mmap_on_dsp(struct fastrpc_file *fl, uint32_t flags,
 
 		VERIFY(err, NULL != (dst_perms = kcalloc(rhvm->vmcount,
 					sizeof(struct qcom_scm_vmperm), GFP_KERNEL)));
-
+		if (err)
+			goto bail;
 		for (i = 0; i < rhvm->vmcount; i++) {
 			dst_perms[i].vmid = rhvm->vmid[i];
 			dst_perms[i].perm = rhvm->vmperm[i];