media: stm32-dcmi: catch dma submission error
authorHugues Fruchet <hugues.fruchet@st.com>
Tue, 22 Aug 2017 14:41:08 +0000 (10:41 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sat, 26 Aug 2017 17:53:34 +0000 (13:53 -0400)
Test cookie return by dmaengine_submit() and return error if any.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/stm32/stm32-dcmi.c

index c2168b5c7810a4cdbcf9bf6d32dd42eae40b1f8a..7ffb2d3e99be679ff47c6d17c48b237764c71898 100644 (file)
@@ -295,6 +295,10 @@ static int dcmi_start_dma(struct stm32_dcmi *dcmi,
 
        /* Push current DMA transaction in the pending queue */
        dcmi->dma_cookie = dmaengine_submit(desc);
+       if (dma_submit_error(dcmi->dma_cookie)) {
+               dev_err(dcmi->dev, "%s: DMA submission failed\n", __func__);
+               return -ENXIO;
+       }
 
        dma_async_issue_pending(dcmi->dma_chan);