diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-04-09 05:06:11 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:57:54 -0400 |
commit | 18bf99aa0cb80b4fa3974a511fd033c2967b04c8 (patch) | |
tree | 901d3d6a7d3cec145fe4604e46d80327d08dda84 /drivers/media/video/gspca/gspca.c | |
parent | 0b62b73778554cd47480ea465f0b255cc63b4336 (diff) |
V4L/DVB: gspca - main: Check the file doing stream on/off
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 68a8431d436d..4fb031cfb64f 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -1590,6 +1590,12 @@ static int vidioc_streamon(struct file *file, void *priv, | |||
1590 | if (mutex_lock_interruptible(&gspca_dev->queue_lock)) | 1590 | if (mutex_lock_interruptible(&gspca_dev->queue_lock)) |
1591 | return -ERESTARTSYS; | 1591 | return -ERESTARTSYS; |
1592 | 1592 | ||
1593 | /* check the capture file */ | ||
1594 | if (gspca_dev->capt_file != file) { | ||
1595 | ret = -EBUSY; | ||
1596 | goto out; | ||
1597 | } | ||
1598 | |||
1593 | if (gspca_dev->nframes == 0 | 1599 | if (gspca_dev->nframes == 0 |
1594 | || !(gspca_dev->frame[0].v4l2_buf.flags & V4L2_BUF_FLAG_QUEUED)) { | 1600 | || !(gspca_dev->frame[0].v4l2_buf.flags & V4L2_BUF_FLAG_QUEUED)) { |
1595 | ret = -EINVAL; | 1601 | ret = -EINVAL; |
@@ -1627,6 +1633,12 @@ static int vidioc_streamoff(struct file *file, void *priv, | |||
1627 | if (mutex_lock_interruptible(&gspca_dev->queue_lock)) | 1633 | if (mutex_lock_interruptible(&gspca_dev->queue_lock)) |
1628 | return -ERESTARTSYS; | 1634 | return -ERESTARTSYS; |
1629 | 1635 | ||
1636 | /* check the capture file */ | ||
1637 | if (gspca_dev->capt_file != file) { | ||
1638 | ret = -EBUSY; | ||
1639 | goto out; | ||
1640 | } | ||
1641 | |||
1630 | /* stop streaming */ | 1642 | /* stop streaming */ |
1631 | if (mutex_lock_interruptible(&gspca_dev->usb_lock)) { | 1643 | if (mutex_lock_interruptible(&gspca_dev->usb_lock)) { |
1632 | ret = -ERESTARTSYS; | 1644 | ret = -ERESTARTSYS; |