Message ID | 20180623223215.7523-9-bigeasy@linutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Sun, Jun 24, 2018 at 12:32:11AM +0200, Sebastian Andrzej Siewior wrote: > From: John Ogness <john.ogness@linutronix.de> > > The portdata spinlock can be taken in interrupt context (via > sierra_outdat_callback()). > Disable interrupts when taking the portdata spinlock. Good catch! As this fixes a potential deadlock, I've reworded the commit message and added a Fixes and stable-CC tag. But as no one appears to have hit this since it was introduced over four years ago, I think this can go into -next along with the rest of the series. All patches now applied. Nice work! Thanks, Johan -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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);