summaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core/videobuf2-core.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-09-07 12:50:02 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-26 15:44:11 -0300
commit8c82c75c3950dea31fe03567125feea089893141 (patch)
tree7338abe2b7cf88a5659f66efe36220147e32e8a7 /drivers/media/v4l2-core/videobuf2-core.c
parentd2210f9e2e269975db413b8fe4de2f07e6a09b05 (diff)
downloadlinux-8c82c75c3950dea31fe03567125feea089893141.tar.bz2
[media] vb2: fix wrong owner check
Check against q->fileio to see if the queue owner should be set or not. The former check against the return value of read or write is wrong, since read/write can return an error, even if the queue is in streaming mode. For example, EAGAIN when in non-blocking mode. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/v4l2-core/videobuf2-core.c')
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index 4da3df61901f..59ed5223393b 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -2278,7 +2278,7 @@ ssize_t vb2_fop_write(struct file *file, char __user *buf,
goto exit;
err = vb2_write(vdev->queue, buf, count, ppos,
file->f_flags & O_NONBLOCK);
- if (err >= 0)
+ if (vdev->queue->fileio)
vdev->queue->owner = file->private_data;
exit:
if (lock)
@@ -2300,7 +2300,7 @@ ssize_t vb2_fop_read(struct file *file, char __user *buf,
goto exit;
err = vb2_read(vdev->queue, buf, count, ppos,
file->f_flags & O_NONBLOCK);
- if (err >= 0)
+ if (vdev->queue->fileio)
vdev->queue->owner = file->private_data;
exit:
if (lock)