media: imx: imx7-media-csi: Fix buffer return upon stream start failure
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 11 May 2021 23:44:40 +0000 (01:44 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 4 Aug 2021 12:43:51 +0000 (14:43 +0200)
commit0ada1697ed4256b38225319c9896661142a3572d
tree3edecb9ccec65b4af4fef45865568415acc97733
parent8b226173a1e9ea1b77dabb3d5583d376c53164c3
media: imx: imx7-media-csi: Fix buffer return upon stream start failure

When the stream fails to start, the first two buffers in the queue have
been moved to the active_vb2_buf array and are returned to vb2 by
imx7_csi_dma_unsetup_vb2_buf(). The function is called with the buffer
state set to VB2_BUF_STATE_ERROR unconditionally, which is correct when
stopping the stream, but not when the start operation fails. In that
case, the state should be set to VB2_BUF_STATE_QUEUED. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/imx/imx7-media-csi.c