aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx
diff options
context:
space:
mode:
authorAidan Thornton <makosoft@googlemail.com>2008-04-13 14:02:24 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:08:48 -0400
commit0ea13e6e59853cab9e8ed3ac231ec5d44d8386a6 (patch)
tree5d9fcef7a7394e753a76955c1c64c3947b1d5ee2 /drivers/media/video/em28xx
parentb957dfdc3161d00b01b52154eb2d53580c8911e5 (diff)
V4L/DVB (7556): 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>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index d6ada6226b54..d3485f500c5e 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -947,6 +947,12 @@ static int vidioc_s_fmt_cap(struct file *file, void *priv,
947 goto out; 947 goto out;
948 } 948 }
949 949
950 if (dev->stream_on && !fh->stream_on) {
951 em28xx_errdev("%s device in use by another fh\n", __func__);
952 rc = -EBUSY;
953 goto out;
954 }
955
950 /* set new image size */ 956 /* set new image size */
951 dev->width = f->fmt.pix.width; 957 dev->width = f->fmt.pix.width;
952 dev->height = f->fmt.pix.height; 958 dev->height = f->fmt.pix.height;