[media] gspca_main: wake wq on streamoff
authorHans de Goede <hdegoede@redhat.com>
Fri, 31 Dec 2010 20:17:51 +0000 (17:17 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 Jan 2011 13:45:00 +0000 (11:45 -0200)
We check for not streaming as a condition to abort waiting in dqbuf, so
when another thread does a streamoff we should wake the wq.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/gspca.c

index 4ab906b..3581dea 100644 (file)
@@ -1634,6 +1634,8 @@ static int vidioc_streamoff(struct file *file, void *priv,
        gspca_dev->usb_err = 0;
        gspca_stream_off(gspca_dev);
        mutex_unlock(&gspca_dev->usb_lock);
+       /* In case another thread is waiting in dqbuf */
+       wake_up_interruptible(&gspca_dev->wq);
 
        /* empty the transfer queues */
        atomic_set(&gspca_dev->fr_q, 0);