From cccaae9d74b546591e67d175b12a135a685e3de9 Mon Sep 17 00:00:00 2001 From: Santosh Sakore Date: Fri, 28 Jul 2023 18:15:38 +0530 Subject: [PATCH] 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 Signed-off-by: Santosh Sakore --- dsp/adsprpc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dsp/adsprpc.c b/dsp/adsprpc.c index af940a59cd..61c5676e04 100644 --- a/dsp/adsprpc.c +++ b/dsp/adsprpc.c @@ -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; }