misc: fastrpc: Clean buffers on remote invocation failures
commit1c8093591d
upstream. With current design, buffers and dma handles are not freed in case of remote invocation failures returned from DSP. This could result in buffer leakings and dma handle pointing to wrong memory in the fastrpc kernel. Adding changes to clean buffers and dma handles even when remote invocation to DSP returns failures. Fixes:c68cfb718c
("misc: fastrpc: Add support for context Invoke method") Cc: stable <stable@kernel.org> Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20231013122007.174464-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c4957f00f9
commit
e0f95b831b
@ -992,11 +992,6 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel,
|
||||
err = wait_for_completion_interruptible(&ctx->work);
|
||||
}
|
||||
|
||||
if (err)
|
||||
goto bail;
|
||||
|
||||
/* Check the response from remote dsp */
|
||||
err = ctx->retval;
|
||||
if (err)
|
||||
goto bail;
|
||||
|
||||
@ -1009,6 +1004,11 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel,
|
||||
goto bail;
|
||||
}
|
||||
|
||||
/* Check the response from remote dsp */
|
||||
err = ctx->retval;
|
||||
if (err)
|
||||
goto bail;
|
||||
|
||||
bail:
|
||||
if (err != -ERESTARTSYS && err != -ETIMEDOUT) {
|
||||
/* We are done with this compute context */
|
||||
|
Reference in New Issue
Block a user