Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f7402a3 authored by Lad, Prabhakar's avatar Lad, Prabhakar Committed by Mauro Carvalho Chehab
Browse files

[media] staging: media: davinci: vpfe: release buffers in case start_streaming call back fails



this patch releases the buffer by calling vb2_buffer_done(),
with state marked as VB2_BUF_STATE_QUEUED if start_streaming()
call back fails.

Signed-off-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 933fd6e5
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1218,8 +1218,16 @@ static int vpfe_start_streaming(struct vb2_queue *vq, unsigned int count)
	video->state = VPFE_VIDEO_BUFFER_QUEUED;

	ret = vpfe_start_capture(video);
	if (ret)
	if (ret) {
		struct vpfe_cap_buffer *buf, *tmp;

		vb2_buffer_done(&video->cur_frm->vb, VB2_BUF_STATE_QUEUED);
		list_for_each_entry_safe(buf, tmp, &video->dma_queue, list) {
			list_del(&buf->list);
			vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
		}
		goto unlock_out;
	}

	mutex_unlock(&video->lock);