summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2018-11-28 03:37:43 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-19 19:19:52 +0100
commit13e318b8680ea1df97ab121bc9bd29e9bd484e60 (patch)
treeccbd7af2658fdb78b0b9c73aa247dcec98cb6dac /drivers/media
parentee310e8ebb9eb53ff3294f36f72554e7c1d7ae54 (diff)
downloadlinux-stable-13e318b8680ea1df97ab121bc9bd29e9bd484e60.tar.gz
linux-stable-13e318b8680ea1df97ab121bc9bd29e9bd484e60.tar.bz2
linux-stable-13e318b8680ea1df97ab121bc9bd29e9bd484e60.zip
media: vb2: don't call __vb2_queue_cancel if vb2_start_streaming failed
commit 04990215dec43c424daff00d1f622167b8aafd1f upstream. vb2_start_streaming() already rolls back the buffers, so there is no need to call __vb2_queue_cancel(). Especially since __vb2_queue_cancel() does too much, such as zeroing the q->queued_count value, causing vb2 to think that no buffers have been queued. It appears that this call to __vb2_queue_cancel() is a left-over from before commit b3379c6201bb3. Fixes: b3379c6201bb3 ('vb2: only call start_streaming if sufficient buffers are queued') Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Cc: <stable@vger.kernel.org> # for v4.16 and up Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/videobuf2/videobuf2-core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
index 5653e8eebe2b..16c7b20cbf61 100644
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -1755,10 +1755,8 @@ int vb2_core_streamon(struct vb2_queue *q, unsigned int type)
if (ret)
return ret;
ret = vb2_start_streaming(q);
- if (ret) {
- __vb2_queue_cancel(q);
+ if (ret)
return ret;
- }
}
q->streaming = 1;