diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2008-10-29 20:16:04 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-11-11 05:11:26 -0500 |
commit | dec0c46ac2af9bbc4a2acd56e5bffbf02f20113e (patch) | |
tree | 64f6c7127d7c9892a5568be1ce5965d89c6ee230 /drivers/media/dvb | |
parent | 8268c8f54505e5b952d1705a7bf3b2a218ed26bf (diff) |
V4L/DVB (9494): anysee: initialize anysee_usb_mutex statically
anysee_usb_mutex is initialized at every time the anysee device is probed.
If the second anysee device is probed while anysee_usb_mutex is locked by
the first anysee device, the mutex is broken.
This patch fixes by initialize anysee_usb_mutex statically rather
than initialize at probe time.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/anysee.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/media/dvb/dvb-usb/anysee.c b/drivers/media/dvb/dvb-usb/anysee.c index c786359fba03..cd2edbcaa097 100644 --- a/drivers/media/dvb/dvb-usb/anysee.c +++ b/drivers/media/dvb/dvb-usb/anysee.c | |||
@@ -46,7 +46,7 @@ module_param_named(delsys, dvb_usb_anysee_delsys, int, 0644); | |||
46 | MODULE_PARM_DESC(delsys, "select delivery mode (0=DVB-C, 1=DVB-T)"); | 46 | MODULE_PARM_DESC(delsys, "select delivery mode (0=DVB-C, 1=DVB-T)"); |
47 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 47 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
48 | 48 | ||
49 | static struct mutex anysee_usb_mutex; | 49 | static DEFINE_MUTEX(anysee_usb_mutex); |
50 | 50 | ||
51 | static int anysee_ctrl_msg(struct dvb_usb_device *d, u8 *sbuf, u8 slen, | 51 | static int anysee_ctrl_msg(struct dvb_usb_device *d, u8 *sbuf, u8 slen, |
52 | u8 *rbuf, u8 rlen) | 52 | u8 *rbuf, u8 rlen) |
@@ -456,8 +456,6 @@ static int anysee_probe(struct usb_interface *intf, | |||
456 | struct usb_host_interface *alt; | 456 | struct usb_host_interface *alt; |
457 | int ret; | 457 | int ret; |
458 | 458 | ||
459 | mutex_init(&anysee_usb_mutex); | ||
460 | |||
461 | /* There is one interface with two alternate settings. | 459 | /* There is one interface with two alternate settings. |
462 | Alternate setting 0 is for bulk transfer. | 460 | Alternate setting 0 is for bulk transfer. |
463 | Alternate setting 1 is for isochronous transfer. | 461 | Alternate setting 1 is for isochronous transfer. |