Skip to content

Commit

Permalink
opticon: Fix resume logic
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Dec 11, 2009
1 parent 82fc594 commit 2a0785e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/serial/opticon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2a0785e

Please sign in to comment.