Skip to content

Commit 030ec2f

Browse files
lyakhlgirdwood
authored andcommitted
chain-dma: fix potential NULL dereference
It has been reported that upon resume certain userspace software tries to use chain DMA without proper initialisation. Prevent DSP exceptions by checking for such cases. Link: #10955 Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 02e0dc9 commit 030ec2f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎src/audio/chain_dma.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ static int chain_host_start(struct comp_dev *dev)
7979
struct chain_dma_data *cd = comp_get_drvdata(dev);
8080
int err;
8181

82+
if (!cd->chan_host || !cd->chan_host->dma) {
83+
comp_err(dev, "incomplete initialization detected, aborting host %p",
84+
cd->chan_host);
85+
return -ENODEV;
86+
}
87+
8288
err = dma_start(cd->chan_host->dma->z_dev, cd->chan_host->index);
8389
if (err < 0)
8490
return err;

0 commit comments

Comments
 (0)