mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
media: vb2: set owner before calling vb2_read
Before vb2_read is called, the owner must be set since vb2_read will actually start streaming. If vb2_read returns an error and q->fileio is NULL, then it failed to start streaming and the owner is set back to NULL. When the vb2 start_streaming callback is called, it expects the owner pointer to be set, and that wasn't the case in this particular situation. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
55f1ecb119
commit
2f8c0810af
1 changed files with 3 additions and 2 deletions
|
@ -1171,10 +1171,11 @@ ssize_t vb2_fop_read(struct file *file, char __user *buf,
|
||||||
return -ERESTARTSYS;
|
return -ERESTARTSYS;
|
||||||
if (vb2_queue_is_busy(vdev->queue, file))
|
if (vb2_queue_is_busy(vdev->queue, file))
|
||||||
goto exit;
|
goto exit;
|
||||||
|
vdev->queue->owner = file->private_data;
|
||||||
err = vb2_read(vdev->queue, buf, count, ppos,
|
err = vb2_read(vdev->queue, buf, count, ppos,
|
||||||
file->f_flags & O_NONBLOCK);
|
file->f_flags & O_NONBLOCK);
|
||||||
if (vdev->queue->fileio)
|
if (!vdev->queue->fileio)
|
||||||
vdev->queue->owner = file->private_data;
|
vdev->queue->owner = NULL;
|
||||||
exit:
|
exit:
|
||||||
if (lock)
|
if (lock)
|
||||||
mutex_unlock(lock);
|
mutex_unlock(lock);
|
||||||
|
|
Loading…
Reference in a new issue