Commit 2b1e0f0a authored by Hans de Goede's avatar Hans de Goede Committed by Ben Hutchings

gspca-core: Fix buffers staying in queued state after a stream_off

commit af05ef01 upstream.

This fixes a regression introduced by commit f7059eaa and should be
backported to all supported stable kernels which have this commit.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Tested-by: default avatarAntonio Ospite <ospite@studenti.unina.it>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent c4a08668
...@@ -1697,7 +1697,7 @@ static int vidioc_streamoff(struct file *file, void *priv, ...@@ -1697,7 +1697,7 @@ static int vidioc_streamoff(struct file *file, void *priv,
enum v4l2_buf_type buf_type) enum v4l2_buf_type buf_type)
{ {
struct gspca_dev *gspca_dev = priv; struct gspca_dev *gspca_dev = priv;
int ret; int i, ret;
if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE) if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL; return -EINVAL;
...@@ -1728,6 +1728,8 @@ static int vidioc_streamoff(struct file *file, void *priv, ...@@ -1728,6 +1728,8 @@ static int vidioc_streamoff(struct file *file, void *priv,
wake_up_interruptible(&gspca_dev->wq); wake_up_interruptible(&gspca_dev->wq);
/* empty the transfer queues */ /* 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_q, 0);
atomic_set(&gspca_dev->fr_i, 0); atomic_set(&gspca_dev->fr_i, 0);
gspca_dev->fr_o = 0; gspca_dev->fr_o = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment