Skip to content

Commit

Permalink
usb: musb: gadget: fix list_head usage
Browse files Browse the repository at this point in the history
commit ad1adb8
(usb: musb: gadget: do not poke with gadget's list_head)
fixed a bug in musb where it was corrupting the list_head
which is supposed to be used by gadget drivers. While
doing that, I forgot to fix the usage in musb_gadget_dequeue()
method. Fix that.

Reported-by: Pavol Kurina <pavol.kurina@emsys.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Felipe Balbi committed Mar 1, 2011
1 parent d105e74 commit 4cbbf08
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/usb/musb/musb_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,8 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *request)
{
struct musb_ep *musb_ep = to_musb_ep(ep);
struct usb_request *r;
struct musb_request *req = to_musb_request(request);
struct musb_request *r;
unsigned long flags;
int status = 0;
struct musb *musb = musb_ep->musb;
Expand All @@ -1285,10 +1286,10 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *request)
spin_lock_irqsave(&musb->lock, flags);

list_for_each_entry(r, &musb_ep->req_list, list) {
if (r == request)
if (r == req)
break;
}
if (r != request) {
if (r != req) {
DBG(3, "request %p not queued to %s\n", request, ep->name);
status = -EINVAL;
goto done;
Expand Down

0 comments on commit 4cbbf08

Please sign in to comment.