media: stm32-dcmi: return buffer in error state on dma error
authorHugues Fruchet <hugues.fruchet@st.com>
Mon, 11 Jun 2018 09:50:25 +0000 (05:50 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 28 Jun 2018 11:46:06 +0000 (07:46 -0400)
Return buffer to V4L2 in error state if DMA error occurs.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/stm32/stm32-dcmi.c

index fc72a57d84782e0df51e0cf3b4ece71838626ef3..526d8311df4a89a5b121a60ede23a3a8ea88d923 100644 (file)
@@ -261,6 +261,9 @@ static void dcmi_dma_callback(void *param)
                break;
        case DMA_ERROR:
                dev_err(dcmi->dev, "%s: Received DMA_ERROR\n", __func__);
+
+               /* Return buffer to V4L2 in error state */
+               dcmi_buffer_done(dcmi, buf, 0, -EIO);
                break;
        case DMA_COMPLETE:
                dev_dbg(dcmi->dev, "%s: Received DMA_COMPLETE\n", __func__);