diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2018-07-05 11:25:19 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-07-25 00:51:39 +0300 |
commit | b509d733d337417bcb7fa4a35be3b9a49332b724 (patch) | |
tree | fe10a5ecfda2ef65f6493d8ec8db3bdfbe091413 /drivers/media/common | |
parent | a50c7738e8ae3276a4b224e321bbd40aee88e8fe (diff) | |
download | linux-b509d733d337417bcb7fa4a35be3b9a49332b724.tar.xz |
media: videobuf2-core: check for q->error in vb2_core_qbuf()
The vb2_core_qbuf() function didn't check if q->error was set. It is
checked in __buf_prepare(), but that function isn't called if the buffer
was already prepared before with VIDIOC_PREPARE_BUF.
So check it at the start of vb2_core_qbuf() as well.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | drivers/media/common/videobuf2/videobuf2-core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index f32ec7342ef0..5653e8eebe2b 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -1377,6 +1377,11 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb) struct vb2_buffer *vb; int ret; + if (q->error) { + dprintk(1, "fatal error occurred on queue\n"); + return -EIO; + } + vb = q->bufs[index]; switch (vb->state) { |