Skip to content

Commit 572a08e

Browse files
andyrosslgirdwood
authored andcommitted
dma_trace: Add missing initialization check
It's possible to reach dma_trace_on() from IPC handlers based on host state before DMA trace has been initialized (found this via fuzzing, so the precise circumstances are a little opaque). When that happens, the schedule_task() call ends up putting a delayed work queue item into the Zephyr queue which has a NULL callback. This eventually blows up later when the timeout expires. Check for initialization state before doing anything. Signed-off-by: Andy Ross <andyross@google.com>
1 parent be0fdda commit 572a08e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/trace/dma-trace.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,9 @@ void dma_trace_flush(void *t)
582582

583583
void dma_trace_on(void)
584584
{
585+
if (!dma_trace_initialized(sof_get()->dmat))
586+
return;
587+
585588
struct dma_trace_data *trace_data = dma_trace_data_get();
586589

587590
if (trace_data->enabled) {

0 commit comments

Comments
 (0)