]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: vb2: fix vb2 state check when start_streaming fails
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 4 Aug 2014 10:14:14 +0000 (07:14 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 20:41:10 +0000 (13:41 -0700)
commit0cc581bb13d8521f4f2f21f647ae5ab6bec060c1
treec1a00647b6251a40b3cd3459669ce9abcf06e7ae
parentdac6454d9de81a766513d157f92971299a228957
media: vb2: fix vb2 state check when start_streaming fails

commit bf3593d939520559774cbfee03ba5f314d909620 upstream.

Commit bd994ddb2a12a3ff48cd549ec82cdceaea9614df (vb2: Fix stream start and
buffer completion race) broke the buffer state check in vb2_buffer_done.

So accept all three possible states there since I can no longer tell the
difference between vb2_buffer_done called from start_streaming or from
elsewhere.

Instead add a WARN_ON at the end of start_streaming that will check whether
any buffers were added to the done list, since that implies that the wrong
state was used as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/v4l2-core/videobuf2-core.c