Skip to content

Commit

Permalink
[media] Fix vivi regression
Browse files Browse the repository at this point in the history
This patch fixes a regression introduced by commit
5126f25:

[media] v4l2-dev: add flag to have the core lock all file operations

I forgot to add the locks to the vivi read operation.

Regards,

	Hans

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jun 11, 2012
1 parent af03891 commit d9762df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/media/video/vivi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,10 +1149,14 @@ static ssize_t
vivi_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
{
struct vivi_dev *dev = video_drvdata(file);
int err;

dprintk(dev, 1, "read called\n");
return vb2_read(&dev->vb_vidq, data, count, ppos,
mutex_lock(&dev->mutex);
err = vb2_read(&dev->vb_vidq, data, count, ppos,
file->f_flags & O_NONBLOCK);
mutex_unlock(&dev->mutex);
return err;
}

static unsigned int
Expand Down

0 comments on commit d9762df

Please sign in to comment.