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 <hmreddy@codeaurora.org>
This commit is contained in:
Himateja Reddy 2020-08-05 10:15:11 -07:00
commit 4d7fb4cc7f

View file

@ -2844,15 +2844,15 @@ static int fastrpc_internal_invoke(struct fastrpc_file *fl, uint32_t mode,
inv_args(ctx);
PERF_END);
VERIFY(err, 0 == (err = ctx->retval));
if (err)
goto bail;
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;
VERIFY(err, 0 == (err = ctx->retval));
if (err)
goto bail;
bail:
if (ctx && interrupted == -ERESTARTSYS) {
trace_fastrpc_context_interrupt(cid, (uint64_t)ctx,