summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-07-05 10:23:17 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 09:04:41 -0700
commitc412589f74ab4f1e30bb25b685fe6d95f2befd4d (patch)
tree3140fd355675d9355c6b864a22e59dad858abd6d
parent445006de7c59a9086b00025f9c3c97c75effd3c5 (diff)
downloadlinux-3.10-c412589f74ab4f1e30bb25b685fe6d95f2befd4d.tar.gz
linux-3.10-c412589f74ab4f1e30bb25b685fe6d95f2befd4d.tar.bz2
linux-3.10-c412589f74ab4f1e30bb25b685fe6d95f2befd4d.zip
gspca-core: Fix buffers staying in queued state after a stream_off
commit af05ef01e9cde84620c6855a8d8ab9c8a1db9009 upstream. [Backport to linux-stable by Antonio Ospite <ospite@studenti.unina.it>] This fixes a regression introduced by commit f7059ea and should be backported to all supported stable kernels which have this commit. Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Tested-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/media/video/gspca/gspca.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index ca5a2b139d0..4dc88527961 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -1723,7 +1723,7 @@ static int vidioc_streamoff(struct file *file, void *priv,
enum v4l2_buf_type buf_type)
{
struct gspca_dev *gspca_dev = priv;
- int ret;
+ int i, ret;
if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
@@ -1754,6 +1754,8 @@ static int vidioc_streamoff(struct file *file, void *priv,
wake_up_interruptible(&gspca_dev->wq);
/* empty the transfer queues */
+ for (i = 0; i < gspca_dev->nframes; i++)
+ gspca_dev->frame[i].v4l2_buf.flags &= ~BUF_ALL_FLAGS;
atomic_set(&gspca_dev->fr_q, 0);
atomic_set(&gspca_dev->fr_i, 0);
gspca_dev->fr_o = 0;