summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHugues Fruchet <hugues.fruchet@st.com>2017-08-22 16:41:08 +0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-26 19:53:34 +0200
commit134e15e6815921cb6db4fa6a0453df3441989fad (patch)
tree550771a1cc06ec345977e3f07f7f1188671e3b17 /drivers/media
parentmedia: v4l: fwnode: Use a less clash-prone name for MAX_DATA_LANES macro (diff)
downloadlinux-134e15e6815921cb6db4fa6a0453df3441989fad.tar.xz
linux-134e15e6815921cb6db4fa6a0453df3441989fad.zip
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')
-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);