diff options
author | Andrew Goodbody <andrew.goodbody@cambrionix.com> | 2016-02-02 20:36:39 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-04 00:52:10 +0300 |
commit | 21619792d1eca7e772ca190ba68588e57f29595b (patch) | |
tree | 0666d7cf6194cc9f1db63f84aad80d038ce4159f /drivers/usb/usbip/usbip_event.c | |
parent | 46e3cafb01feb107a681e89fd9b4f1cd938a601f (diff) | |
download | linux-21619792d1eca7e772ca190ba68588e57f29595b.tar.xz |
usb: usbip: Fix possible deadlocks reported by lockdep
Change spin_lock calls to spin_lock_irqsave to prevent
attmpted recursive lock taking in interrupt context.
This patch fixes Bug 109351
https://bugzilla.kernel.org/show_bug.cgi?id=109351
Signed-off-by: Andrew Goodbody <andrew.goodbody@cambrionix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/usbip/usbip_event.c')
-rw-r--r-- | drivers/usb/usbip/usbip_event.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/usbip/usbip_event.c b/drivers/usb/usbip/usbip_event.c index 64933b993d7a..2580a32bcdff 100644 --- a/drivers/usb/usbip/usbip_event.c +++ b/drivers/usb/usbip/usbip_event.c @@ -117,11 +117,12 @@ EXPORT_SYMBOL_GPL(usbip_event_add); int usbip_event_happened(struct usbip_device *ud) { int happened = 0; + unsigned long flags; - spin_lock(&ud->lock); + spin_lock_irqsave(&ud->lock, flags); if (ud->event != 0) happened = 1; - spin_unlock(&ud->lock); + spin_unlock_irqrestore(&ud->lock, flags); return happened; } |