diff options
Diffstat (limited to 'drivers/usb/misc/iowarrior.c')
-rw-r--r-- | drivers/usb/misc/iowarrior.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index e75bb87ee92b..d3c852363883 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c | |||
@@ -139,7 +139,7 @@ static int usb_set_report(struct usb_interface *intf, unsigned char type, | |||
139 | /* driver registration */ | 139 | /* driver registration */ |
140 | /*---------------------*/ | 140 | /*---------------------*/ |
141 | /* table of devices that work with this driver */ | 141 | /* table of devices that work with this driver */ |
142 | static struct usb_device_id iowarrior_ids[] = { | 142 | static const struct usb_device_id iowarrior_ids[] = { |
143 | {USB_DEVICE(USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW40)}, | 143 | {USB_DEVICE(USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW40)}, |
144 | {USB_DEVICE(USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW24)}, | 144 | {USB_DEVICE(USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW24)}, |
145 | {USB_DEVICE(USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOWPV1)}, | 145 | {USB_DEVICE(USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOWPV1)}, |
@@ -602,10 +602,12 @@ static int iowarrior_open(struct inode *inode, struct file *file) | |||
602 | 602 | ||
603 | dbg("%s", __func__); | 603 | dbg("%s", __func__); |
604 | 604 | ||
605 | lock_kernel(); | ||
605 | subminor = iminor(inode); | 606 | subminor = iminor(inode); |
606 | 607 | ||
607 | interface = usb_find_interface(&iowarrior_driver, subminor); | 608 | interface = usb_find_interface(&iowarrior_driver, subminor); |
608 | if (!interface) { | 609 | if (!interface) { |
610 | unlock_kernel(); | ||
609 | err("%s - error, can't find device for minor %d", __func__, | 611 | err("%s - error, can't find device for minor %d", __func__, |
610 | subminor); | 612 | subminor); |
611 | return -ENODEV; | 613 | return -ENODEV; |
@@ -615,6 +617,7 @@ static int iowarrior_open(struct inode *inode, struct file *file) | |||
615 | dev = usb_get_intfdata(interface); | 617 | dev = usb_get_intfdata(interface); |
616 | if (!dev) { | 618 | if (!dev) { |
617 | mutex_unlock(&iowarrior_open_disc_lock); | 619 | mutex_unlock(&iowarrior_open_disc_lock); |
620 | unlock_kernel(); | ||
618 | return -ENODEV; | 621 | return -ENODEV; |
619 | } | 622 | } |
620 | 623 | ||
@@ -641,6 +644,7 @@ static int iowarrior_open(struct inode *inode, struct file *file) | |||
641 | 644 | ||
642 | out: | 645 | out: |
643 | mutex_unlock(&dev->mutex); | 646 | mutex_unlock(&dev->mutex); |
647 | unlock_kernel(); | ||
644 | return retval; | 648 | return retval; |
645 | } | 649 | } |
646 | 650 | ||