[Sound-open-firmware] [PATCH] ipc: trap dma_start() return value, bail on error
Detected with Coverity, we check dma_start everywhere else.
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- src/ipc/ipc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/ipc/ipc.c b/src/ipc/ipc.c index fbb1be6..3e23d9c 100644 --- a/src/ipc/ipc.c +++ b/src/ipc/ipc.c @@ -482,7 +482,11 @@ int ipc_get_page_descriptors(struct dma *dmac, uint8_t *page_table, wait_init(&complete);
/* start the copy of page table to DSP */ - dma_start(dmac, chan); + ret = dma_start(dmac, chan); + if (ret < 0) { + trace_ipc_error("ePt"); + goto out; + }
/* wait for DMA to complete */ complete.timeout = PLATFORM_HOST_DMA_TIMEOUT;
On Fri, 2018-05-18 at 18:39 -0500, Pierre-Louis Bossart wrote:
Detected with Coverity, we check dma_start everywhere else.
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
src/ipc/ipc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/ipc/ipc.c b/src/ipc/ipc.c index fbb1be6..3e23d9c 100644 --- a/src/ipc/ipc.c +++ b/src/ipc/ipc.c @@ -482,7 +482,11 @@ int ipc_get_page_descriptors(struct dma *dmac, uint8_t *page_table, wait_init(&complete);
/* start the copy of page table to DSP */
- dma_start(dmac, chan);
ret = dma_start(dmac, chan);
if (ret < 0) {
trace_ipc_error("ePt");
goto out;
}
/* wait for DMA to complete */ complete.timeout = PLATFORM_HOST_DMA_TIMEOUT;
Applied.
Thanks
Liam
participants (2)
-
Liam Girdwood
-
Pierre-Louis Bossart