Commit a283d080 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: sierra: do not resume I/O on closed ports

Do not resume any I/O, including the delayed write queue, on closed
ports.

Note that this currently has no functional impact due to the
usb_autopm_get_interface() in close(), but that call is about to be
removed by a follow-up patch.
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 40d88983
...@@ -1013,7 +1013,7 @@ static int sierra_resume(struct usb_serial *serial) ...@@ -1013,7 +1013,7 @@ static int sierra_resume(struct usb_serial *serial)
port = serial->port[i]; port = serial->port[i];
portdata = usb_get_serial_port_data(port); portdata = usb_get_serial_port_data(port);
if (!portdata) if (!portdata || !portdata->opened)
continue; continue;
while ((urb = usb_get_from_anchor(&portdata->delayed))) { while ((urb = usb_get_from_anchor(&portdata->delayed))) {
...@@ -1036,11 +1036,9 @@ static int sierra_resume(struct usb_serial *serial) ...@@ -1036,11 +1036,9 @@ static int sierra_resume(struct usb_serial *serial)
} }
} }
if (portdata->opened) { err = sierra_submit_rx_urbs(port, GFP_ATOMIC);
err = sierra_submit_rx_urbs(port, GFP_ATOMIC); if (err)
if (err) ec++;
ec++;
}
} }
intfdata->suspended = 0; intfdata->suspended = 0;
spin_unlock_irq(&intfdata->susp_lock); spin_unlock_irq(&intfdata->susp_lock);
......
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