mirror of https://github.com/thesofproject/sof.git
ipc: ipc3: handler: Fix error handling in ipc_dma_trace_config()
We need to free up the allocated SG in case of a failure after a successful ipc_process_host_buffer() call, which does the allocation. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
This commit is contained in:
parent
1745148343
commit
fbab621c9b
|
@ -824,7 +824,7 @@ static int ipc_dma_trace_config(uint32_t header)
|
|||
&elem_array,
|
||||
&ring_size);
|
||||
if (err < 0)
|
||||
goto error;
|
||||
goto processing_error;
|
||||
|
||||
err = dma_trace_host_buffer(dmat, &elem_array, ring_size);
|
||||
if (err < 0) {
|
||||
|
@ -849,6 +849,12 @@ static int ipc_dma_trace_config(uint32_t header)
|
|||
return 0;
|
||||
|
||||
error:
|
||||
#if CONFIG_HOST_PTABLE
|
||||
dma_sg_free(&elem_array);
|
||||
|
||||
processing_error:
|
||||
#endif
|
||||
|
||||
return err;
|
||||
}
|
||||
#endif /* CONFIG_SUECREEK */
|
||||
|
|
Loading…
Reference in New Issue