dma-trace: dma_sg_free() can not be used to free SOF_MEM_ZONE_SYS allocations

dma_sg_alloc() is called with SOF_MEM_ZONE_SYS which can not be freed up.

dma config or start error skip the free as it is not going to work anyways.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
This commit is contained in:
Peter Ujfalusi 2021-12-17 11:56:58 +02:00 committed by Liam Girdwood
parent 9c3452330d
commit 1ae525ad37
1 changed files with 3 additions and 6 deletions

View File

@ -379,22 +379,19 @@ static int dma_trace_start(struct dma_trace_data *d)
config.direction,
elem_num, elem_size, elem_addr, 0);
if (err < 0)
goto err_alloc;
goto error;
err = dma_set_config(d->dc.chan, &config);
if (err < 0) {
mtrace_printf(LOG_LEVEL_ERROR, "dma_set_config() failed: %d", err);
goto err_config;
goto error;
}
err = dma_start(d->dc.chan);
if (err == 0)
return 0;
err_config:
dma_sg_free(&config.elem_array);
err_alloc:
error:
dma_channel_put(d->dc.chan);
d->dc.chan = NULL;