Commit 2a0785ea authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

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: default avatarAlan Cox <alan@linux.intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 82fc5943
...@@ -502,7 +502,8 @@ static int opticon_resume(struct usb_interface *intf) ...@@ -502,7 +502,8 @@ static int opticon_resume(struct usb_interface *intf)
int result; int result;
mutex_lock(&port->port.mutex); 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); result = usb_submit_urb(priv->bulk_read_urb, GFP_NOIO);
else else
result = 0; result = 0;
......
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