diff options
author | Hans de Goede <hdegoede@redhat.com> | 2010-12-30 23:54:33 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-01-19 14:44:54 +0100 |
commit | 27074efa2ee8c1ef07dc5f644104e35d39e43322 (patch) | |
tree | 2ba18e26633ad557b37cc3b42c1cd1381c069d61 /drivers/media/video/gspca/gspca.h | |
parent | [media] gspca_main: Locking fixes 1 (diff) | |
download | linux-27074efa2ee8c1ef07dc5f644104e35d39e43322.tar.xz linux-27074efa2ee8c1ef07dc5f644104e35d39e43322.zip |
[media] gspca_main: Locking fixes 2
Before this patch vidioc_dqbuf is using its own read_lock, where as
other queue related functions use queue_lock. This means that dqbuf is
accessing several variables in a racy manor. The most important one
being fr_o, which may be changed from underneath dqbuf by vidioc_reqbufs
or vidioc_streamoff. Other variables which it accesses unprotected
are gspca_dev->memory, gspca_dev->streaming and gspca_dev->capt_file.
This patch fixes this by changing vidioc_dqbuf to also use the queue_lock.
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>
Diffstat (limited to '')
-rw-r--r-- | drivers/media/video/gspca/gspca.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h index 97b77a26a2eb..a2a1a6aa0606 100644 --- a/drivers/media/video/gspca/gspca.h +++ b/drivers/media/video/gspca/gspca.h @@ -205,7 +205,6 @@ struct gspca_dev { wait_queue_head_t wq; /* wait queue */ struct mutex usb_lock; /* usb exchange protection */ - struct mutex read_lock; /* read protection */ struct mutex queue_lock; /* ISOC queue protection */ int usb_err; /* USB error - protected by usb_lock */ u16 pkt_size; /* ISOC packet size */ |