Skip to content

Commit

Permalink
[media] v4l: soc-camera: fix multiple simultaneous user case
Browse files Browse the repository at this point in the history
A recent patch has introduced a regression, whereby a second open of an
soc-camera video device breaks the running capture. This patch fixes this bug
by guaranteeing, that video buffers get initialised only during the first open
of the device node.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Dec 26, 2010
1 parent 501aaa1 commit 24d8c02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/video/soc_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,13 @@ static int soc_camera_open(struct file *file)
ret = soc_camera_set_fmt(icd, &f);
if (ret < 0)
goto esfmt;

ici->ops->init_videobuf(&icd->vb_vidq, icd);
}

file->private_data = icd;
dev_dbg(&icd->dev, "camera device open\n");

ici->ops->init_videobuf(&icd->vb_vidq, icd);

mutex_unlock(&icd->video_lock);

return 0;
Expand Down

0 comments on commit 24d8c02

Please sign in to comment.