adsprpc: validate VMID before hyp_assign during unmap

Validate VMID before doing hyp_assign_phys during unmap on DSP.

Change-Id: I9c41416c9df12bd993bff59378ea66d31cda3686
Acked-by: Thyagarajan Venkatanarayanan <venkatan@qti.qualcomm.com>
Signed-off-by: Tharun Kumar Merugu <mtharu@codeaurora.org>
This commit is contained in:
Tharun Kumar Merugu 2018-04-17 18:08:07 +05:30
parent 4cec0cd668
commit 48be0c6411

View File

@ -2041,12 +2041,15 @@ static int fastrpc_munmap_on_dsp_rh(struct fastrpc_file *fl,
err = scm_call2(SCM_SIP_FNID(SCM_SVC_PIL,
TZ_PIL_CLEAR_PROTECT_MEM_SUBSYS_ID), &desc);
} else if (map->flags == ADSP_MMAP_REMOTE_HEAP_ADDR) {
VERIFY(err, !hyp_assign_phys(map->phys, (uint64_t)map->size,
if (me->channel[fl->cid].rhvm.vmid) {
VERIFY(err, !hyp_assign_phys(map->phys,
(uint64_t)map->size,
me->channel[fl->cid].rhvm.vmid,
me->channel[fl->cid].rhvm.vmcount,
destVM, destVMperm, 1));
if (err)
goto bail;
if (err)
goto bail;
}
}
bail: