[media] gspca_main: Locking fixes 1
authorHans de Goede <hdegoede@redhat.com>
Thu, 30 Dec 2010 16:11:21 +0000 (13:11 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 Jan 2011 13:44:53 +0000 (11:44 -0200)
commit4e770f7602fb2285f3106f98109d0685618ddc22
tree0ee5912a6514a3889f8f5b08cbe1e9cb1ae2cf5f
parent82f4b5b67e795fe03952b278873712e4562304d2
[media] gspca_main: Locking fixes 1

The gspca_dev->streaming boolean is protected against multiple access
through gspca_dev->queue_lock everywhere except for 2 places. This patch
fixes this by bringing it under the lock in vidioc_streamoff. And by
removing the check for gspca_dev->streaming in gspca_disconnect,
the destroy_urbs call may be called multiple times (and is protected
by the usb_lock) and calling wake_up_interruptible can also always be done
safely.

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