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

USB: sierra: fix AA deadlock in open error path

Fix AA deadlock in open error path that would call close() and try to
grab the already held disc_mutex.

Fixes: b9a44bc1 ("sierra: driver urb handling improvements")

Cc: <stable@vger.kernel.org>	# v2.6.31
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 549e8350
...@@ -816,14 +816,9 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -816,14 +816,9 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)
usb_sndbulkpipe(serial->dev, endpoint) | USB_DIR_IN); usb_sndbulkpipe(serial->dev, endpoint) | USB_DIR_IN);
err = sierra_submit_rx_urbs(port, GFP_KERNEL); err = sierra_submit_rx_urbs(port, GFP_KERNEL);
if (err) { if (err)
/* get rid of everything as in close */ goto err_submit;
sierra_close(port);
/* restore balance for autopm */
if (!serial->disconnected)
usb_autopm_put_interface(serial->interface);
return err;
}
sierra_send_setup(port); sierra_send_setup(port);
serial->interface->needs_remote_wakeup = 1; serial->interface->needs_remote_wakeup = 1;
...@@ -833,6 +828,16 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -833,6 +828,16 @@ static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)
usb_autopm_put_interface(serial->interface); usb_autopm_put_interface(serial->interface);
return 0; return 0;
err_submit:
sierra_stop_rx_urbs(port);
for (i = 0; i < portdata->num_in_urbs; i++) {
sierra_release_urb(portdata->in_urbs[i]);
portdata->in_urbs[i] = NULL;
}
return err;
} }
......
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