From 69e8685d1bf06a3930c6af9abbf5d4187c332967 Mon Sep 17 00:00:00 2001 From: Himateja Reddy Date: Mon, 13 Jul 2020 11:35:56 -0700 Subject: [PATCH] msm: adsprpc: Clean buffers on remote invocation failure Current code doesn't clean up buffers and dma handles when failure is seen in the remote invocation to DSP. This will end up leaking buffers and also dma handles pointing to wrong memory in the fastrpc kernel. Clean buffers and dma handles even when remote invocation to DSP returns failure. Change-Id: I23998a1825f14a4c97380e284626df18f5045ed8 Signed-off-by: Himateja Reddy --- drivers/char/adsprpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index 6fee57eb9d1b..9309ce43f454 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -2412,13 +2412,13 @@ static int fastrpc_internal_invoke(struct fastrpc_file *fl, uint32_t mode, inv_args(ctx); PERF_END); - VERIFY(err, 0 == (err = ctx->retval)); + PERF(fl->profile, GET_COUNTER(perf_counter, PERF_PUTARGS), + VERIFY(err, 0 == (err = put_args(kernel, ctx, invoke->pra))); + PERF_END); if (err) goto bail; - PERF(fl->profile, GET_COUNTER(perf_counter, PERF_PUTARGS), - VERIFY(err, 0 == put_args(kernel, ctx, invoke->pra)); - PERF_END); + VERIFY(err, 0 == (err = ctx->retval)); if (err) goto bail; bail: