Message ID | 20230201161153.883376-2-hverkuil-cisco@xs4all.nl |
---|---|
State | Accepted |
Commit | 2f8c0810af739ec3587d00bf36cc5a6a0139be1a |
Headers | show |
Series | cx18: convert to vb2 | expand |
diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c index 1f5d235a8441..c7a54d82a55e 100644 --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c @@ -1171,10 +1171,11 @@ ssize_t vb2_fop_read(struct file *file, char __user *buf, return -ERESTARTSYS; if (vb2_queue_is_busy(vdev->queue, file)) goto exit; + vdev->queue->owner = file->private_data; err = vb2_read(vdev->queue, buf, count, ppos, file->f_flags & O_NONBLOCK); - if (vdev->queue->fileio) - vdev->queue->owner = file->private_data; + if (!vdev->queue->fileio) + vdev->queue->owner = NULL; exit: if (lock) mutex_unlock(lock);