upstream: [media] vb2: Check if there are buffers before streamon
authorRicardo Ribalda <ricardo.ribalda@gmail.com>
Wed, 8 Jan 2014 08:01:33 +0000 (05:01 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:54:33 +0000 (11:54 +0900)
commit02b986f5b1157bf06a5e7df033627f085be443bf
tree34d1676d81e20dd442bebdb4c0b3d55bb7d33387
parente66105a5c68eaf981bf1fb3ea7e94d468355b020
upstream: [media] vb2: Check if there are buffers before streamon

This patch adds a test preventing streamon() if there is no buffer
ready.

Without this patch, a user could call streamon() before
preparing any buffer. This leads to a situation where if he calls
close() before calling streamoff() the device is kept streaming.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/videobuf2-core.c