diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-09-07 11:50:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-26 14:44:11 -0400 |
commit | 8c82c75c3950dea31fe03567125feea089893141 (patch) | |
tree | 7338abe2b7cf88a5659f66efe36220147e32e8a7 /drivers/media/v4l2-core | |
parent | d2210f9e2e269975db413b8fe4de2f07e6a09b05 (diff) |
[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')
-rw-r--r-- | drivers/media/v4l2-core/videobuf2-core.c | 4 |
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, | |||
2278 | goto exit; | 2278 | goto exit; |
2279 | err = vb2_write(vdev->queue, buf, count, ppos, | 2279 | err = vb2_write(vdev->queue, buf, count, ppos, |
2280 | file->f_flags & O_NONBLOCK); | 2280 | file->f_flags & O_NONBLOCK); |
2281 | if (err >= 0) | 2281 | if (vdev->queue->fileio) |
2282 | vdev->queue->owner = file->private_data; | 2282 | vdev->queue->owner = file->private_data; |
2283 | exit: | 2283 | exit: |
2284 | if (lock) | 2284 | if (lock) |
@@ -2300,7 +2300,7 @@ ssize_t vb2_fop_read(struct file *file, char __user *buf, | |||
2300 | goto exit; | 2300 | goto exit; |
2301 | err = vb2_read(vdev->queue, buf, count, ppos, | 2301 | err = vb2_read(vdev->queue, buf, count, ppos, |
2302 | file->f_flags & O_NONBLOCK); | 2302 | file->f_flags & O_NONBLOCK); |
2303 | if (err >= 0) | 2303 | if (vdev->queue->fileio) |
2304 | vdev->queue->owner = file->private_data; | 2304 | vdev->queue->owner = file->private_data; |
2305 | exit: | 2305 | exit: |
2306 | if (lock) | 2306 | if (lock) |