Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/ipc/dma-copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ int dma_copy_to_host_nowait(struct dma_copy *dc, struct dma_sg_config *host_sg,
{
int ret;

/* return if DMA channel is not get yet */
if (!dc->chan)
return -EINVAL;

/* tell gateway to copy */
ret = dma_copy(dc->chan, size, 0);
if (ret < 0)
Expand All @@ -85,6 +89,10 @@ int dma_copy_to_host_nowait(struct dma_copy *dc, struct dma_sg_config *host_sg,
int32_t err;
int32_t offset = host_offset;

/* return if DMA channel is not get yet */
if (!dc->chan)
return -EINVAL;

if (size <= 0)
return 0;

Expand Down
4 changes: 3 additions & 1 deletion src/platform/intel/cavs/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,9 @@ int platform_init(struct sof *sof)
#elif CONFIG_TRACE
/* Initialize DMA for Trace*/
trace_point(TRACE_BOOT_PLATFORM_DMA_TRACE);
dma_trace_init_complete(sof->dmat);
ret = dma_trace_init_complete(sof->dmat);
if (ret < 0)
return ret;
#endif

/* show heap status */
Expand Down
6 changes: 2 additions & 4 deletions src/trace/dma-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,8 @@ void dma_trace_on(void)
{
struct dma_trace_data *trace_data = dma_trace_data_get();

if (trace_data->enabled) {
if (!trace_data || trace_data->enabled)
return;
}

trace_data->enabled = 1;
schedule_task(&trace_data->dmat_work, DMA_TRACE_PERIOD,
Expand All @@ -490,9 +489,8 @@ void dma_trace_off(void)
{
struct dma_trace_data *trace_data = dma_trace_data_get();

if (!trace_data->enabled) {
if (!trace_data || !trace_data->enabled)
return;
}

schedule_task_cancel(&trace_data->dmat_work);
trace_data->enabled = 0;
Expand Down
3 changes: 1 addition & 2 deletions src/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,8 @@ void trace_log_unfiltered(bool send_atomic, const void *log_entry, const struct
struct trace *trace = trace_get();
va_list vl;

if (!trace->enable) {
if (!trace || !trace->enable)
return;
}

va_start(vl, arg_count);
vatrace_log(send_atomic, (uint32_t)log_entry, ctx, lvl, id_1, id_2, arg_count, vl);
Expand Down