summaryrefslogtreecommitdiff
path: root/drivers/media/platform/stm32
diff options
context:
space:
mode:
authorHugues Fruchet <hugues.fruchet@st.com>2017-08-22 17:41:08 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-26 20:53:34 +0300
commit134e15e6815921cb6db4fa6a0453df3441989fad (patch)
tree550771a1cc06ec345977e3f07f7f1188671e3b17 /drivers/media/platform/stm32
parentad3cdf3e1f37299fc1422f7828243635249a3dde (diff)
downloadlinux-134e15e6815921cb6db4fa6a0453df3441989fad.tar.xz
media: stm32-dcmi: catch dma submission error
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>
Diffstat (limited to 'drivers/media/platform/stm32')
-rw-r--r--drivers/media/platform/stm32/stm32-dcmi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
index c2168b5c7810..7ffb2d3e99be 100644
--- a/drivers/media/platform/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/stm32/stm32-dcmi.c
@@ -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);