msm: adsprpc: Return fail when hyp assign failed.

Currently the error code from hype assign failure is over writing by
fastrpc_unmap_on_dsp success and returning the false success. So added
separate variable to capture the error from fastrpc_unmap_on_dsp.

Change-Id: I6444635925416d8ef96800a02e8a1e3e550fa011
Acked-by: Ramesh Nallagopu <rnallago@qti.qualcomm.com>
Signed-off-by: Santosh Sakore <quic_ssakore@quicinc.com>
This commit is contained in:
Santosh Sakore
2023-07-28 18:15:38 +05:30
parent 15b180fee9
commit cccaae9d74

View File

@@ -4931,16 +4931,18 @@ static int fastrpc_mmap_on_dsp(struct fastrpc_file *fl, uint32_t flags,
&src_perms, dst_perms, rhvm->vmcount);
kfree(dst_perms);
if (err) {
int unmap_err = 0;
ADSPRPC_ERR(
"rh hyp assign failed with %d for phys 0x%llx, size %zu\n",
err, phys, size);
err = -EADDRNOTAVAIL;
err = fastrpc_unmap_on_dsp(fl,
unmap_err = fastrpc_unmap_on_dsp(fl,
*raddr, phys, size, flags);
if (err) {
if (unmap_err) {
ADSPRPC_ERR(
"failed to unmap %d for phys 0x%llx, size %zd\n",
err, phys, size);
unmap_err, phys, size);
}
goto bail;
}