From: Alan Stern Date: Fri, 28 Jul 2006 21:07:34 +0000 (-0400) Subject: USB: dummy-hcd: disable interrupts during req->complete X-Git-Tag: v2.6.18-rc4~66^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=b4dbda1a22d236842b75be4e2679a96a4fd72632;p=linux-2.6-omap-h63xx.git USB: dummy-hcd: disable interrupts during req->complete This patch (as756) fixes a bug in dummy-hcd found by the lockdep checker. In one of the code paths, the driver did not disable interrupts before calling a request completion routine. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 4be47195bd3..7d1c22c3495 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -609,7 +609,8 @@ static int dummy_dequeue (struct usb_ep *_ep, struct usb_request *_req) if (!dum->driver) return -ESHUTDOWN; - spin_lock_irqsave (&dum->lock, flags); + local_irq_save (flags); + spin_lock (&dum->lock); list_for_each_entry (req, &ep->queue, queue) { if (&req->req == _req) { list_del_init (&req->queue); @@ -618,7 +619,7 @@ static int dummy_dequeue (struct usb_ep *_ep, struct usb_request *_req) break; } } - spin_unlock_irqrestore (&dum->lock, flags); + spin_unlock (&dum->lock); if (retval == 0) { dev_dbg (udc_dev(dum), @@ -626,6 +627,7 @@ static int dummy_dequeue (struct usb_ep *_ep, struct usb_request *_req) req, _ep->name, _req->length, _req->buf); _req->complete (_ep, _req); } + local_irq_restore (flags); return retval; }