projects/linux·commit 24d8c029

[media] v4l: soc-camera: fix multiple simultaneous user case

24d8c029 · Guennadi Liakhovetski <[email protected]> · 2010-12-25 18:29:52 -03:00

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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Commit
24d8c0293b04ad207648bb2a0dbfebff8b47d166
Parents
501aaa11

Changes

1 files changed · +2 −2

FileStatusAddDelContent
drivers/media/video/soc_camera.cmodified+2−2View file

drivers/media/video/soc_camera.c

View file
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index 335120c..052bd6d 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -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;