summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-13 12:02:24 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-13 12:02:24 -0300
commitfb0ecb723f596bc9c34f10219f35e615736400c7 (patch)
treeb7aabe26c295dc35faec847186b6059d4e2ea709
parent8010a5bd46af7405df1730fd12dff88753d717ba (diff)
downloadmediapointer-dvb-s2-fb0ecb723f596bc9c34f10219f35e615736400c7.tar.gz
mediapointer-dvb-s2-fb0ecb723f596bc9c34f10219f35e615736400c7.tar.bz2
em28xx: fix locking on vidioc_s_fmt_cap
Currently, vidioc_s_fmt_cap is allowed even if streaming is running on some other fh. This is likely to cause issues. Block use of vidioc_s_fmt_cap if someone else has claimed access to the device. Signed-Off-By: Aidan Thornton <makosoft@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-video.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c
index b96fc598c..91bbd3432 100644
--- a/linux/drivers/media/video/em28xx/em28xx-video.c
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c
@@ -973,6 +973,12 @@ static int vidioc_s_fmt_cap(struct file *file, void *priv,
goto out;
}
+ if (dev->stream_on && !fh->stream_on) {
+ em28xx_errdev("%s device in use by another fh\n", __func__);
+ rc = -EBUSY;
+ goto out;
+ }
+
/* set new image size */
dev->width = f->fmt.pix.width;
dev->height = f->fmt.pix.height;