From: Alan Cox Date: Tue, 6 Oct 2009 15:06:57 +0000 (+0100) Subject: opticon: Fix resume logic X-Git-Tag: v2.6.33-rc1~310^2~41 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=2a0785ea375fe93cd480599bb40d0c837ff72a2e;p=~emulex%2Finfiniband.git 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 Cc: Alan Stern Cc: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index c03fdc0242d..4cdb975caa8 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;