Commit dec0c46a authored by Akinobu Mita's avatar Akinobu Mita Committed by Mauro Carvalho Chehab

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: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 8268c8f5
...@@ -46,7 +46,7 @@ module_param_named(delsys, dvb_usb_anysee_delsys, int, 0644); ...@@ -46,7 +46,7 @@ module_param_named(delsys, dvb_usb_anysee_delsys, int, 0644);
MODULE_PARM_DESC(delsys, "select delivery mode (0=DVB-C, 1=DVB-T)"); MODULE_PARM_DESC(delsys, "select delivery mode (0=DVB-C, 1=DVB-T)");
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
static struct mutex anysee_usb_mutex; static DEFINE_MUTEX(anysee_usb_mutex);
static int anysee_ctrl_msg(struct dvb_usb_device *d, u8 *sbuf, u8 slen, static int anysee_ctrl_msg(struct dvb_usb_device *d, u8 *sbuf, u8 slen,
u8 *rbuf, u8 rlen) u8 *rbuf, u8 rlen)
...@@ -456,8 +456,6 @@ static int anysee_probe(struct usb_interface *intf, ...@@ -456,8 +456,6 @@ static int anysee_probe(struct usb_interface *intf,
struct usb_host_interface *alt; struct usb_host_interface *alt;
int ret; int ret;
mutex_init(&anysee_usb_mutex);
/* There is one interface with two alternate settings. /* There is one interface with two alternate settings.
Alternate setting 0 is for bulk transfer. Alternate setting 0 is for bulk transfer.
Alternate setting 1 is for isochronous transfer. Alternate setting 1 is for isochronous transfer.
......
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