From: Hugues Fruchet Date: Tue, 22 Aug 2017 14:41:08 +0000 (-0400) Subject: media: stm32-dcmi: catch dma submission error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=134e15e6815921cb6db4fa6a0453df3441989fad;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git media: stm32-dcmi: catch dma submission error Test cookie return by dmaengine_submit() and return error if any. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- 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);