summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/opticon.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-10-06 19:06:57 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-12 02:18:04 +0300
commit2a0785ea375fe93cd480599bb40d0c837ff72a2e (patch)
tree270c1b837414753a3c08be2997426df45fa5fa63 /drivers/usb/serial/opticon.c
parent82fc5943430e3cbf15033ed4186a73f90906345d (diff)
downloadlinux-2a0785ea375fe93cd480599bb40d0c837ff72a2e.tar.xz
opticon: Fix resume logic
Opticon now takes the right mutex to check the port status but the status check is done wrongly for the modern serial code, so fix it. Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/opticon.c')
-rw-r--r--drivers/usb/serial/opticon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index c03fdc0242dd..4cdb975caa89 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -502,7 +502,8 @@ static int opticon_resume(struct usb_interface *intf)
int result;
mutex_lock(&port->port.mutex);
- if (port->port.count)
+ /* This is protected by the port mutex against close/open */
+ if (test_bit(ASYNCB_INITIALIZED, &port->port.flags))
result = usb_submit_urb(priv->bulk_read_urb, GFP_NOIO);
else
result = 0;