summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/sierra.c
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2018-06-24 00:32:11 +0200
committerJohan Hovold <johan@kernel.org>2018-06-26 15:12:49 +0200
commite60870012e5a35b1506d7b376fddfb30e9da0b27 (patch)
tree98cc954a1e570a9aa51d4f492c7cf87aa7a1a903 /drivers/usb/serial/sierra.c
parent2ba02c8dd063c4396111629e96dec5a3f231f995 (diff)
USB: serial: sierra: fix potential deadlock at close
The portdata spinlock can be taken in interrupt context (via sierra_outdat_callback()). Disable interrupts when taking the portdata spinlock when discarding deferred URBs during close to prevent a possible deadlock. Fixes: 014333f77c0b ("USB: sierra: fix urb and memory leak on disconnect") Cc: stable <stable@vger.kernel.org> Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> [ johan: amend commit message and add fixes and stable tags ] Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/sierra.c')
-rw-r--r--drivers/usb/serial/sierra.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index d189f953c891..55956a638f5b 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -770,9 +770,9 @@ static void sierra_close(struct usb_serial_port *port)
kfree(urb->transfer_buffer);
usb_free_urb(urb);
usb_autopm_put_interface_async(serial->interface);
- spin_lock(&portdata->lock);
+ spin_lock_irq(&portdata->lock);
portdata->outstanding_urbs--;
- spin_unlock(&portdata->lock);
+ spin_unlock_irq(&portdata->lock);
}
sierra_stop_rx_urbs(port);