提交 4cbbf084 编写于 作者: F Felipe Balbi

usb: musb: gadget: fix list_head usage

commit ad1adb89
(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: NPavol Kurina <pavol.kurina@emsys.de>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 d105e74e
...@@ -1274,7 +1274,8 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, ...@@ -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) static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *request)
{ {
struct musb_ep *musb_ep = to_musb_ep(ep); 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; unsigned long flags;
int status = 0; int status = 0;
struct musb *musb = musb_ep->musb; struct musb *musb = musb_ep->musb;
...@@ -1285,10 +1286,10 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *request) ...@@ -1285,10 +1286,10 @@ static int musb_gadget_dequeue(struct usb_ep *ep, struct usb_request *request)
spin_lock_irqsave(&musb->lock, flags); spin_lock_irqsave(&musb->lock, flags);
list_for_each_entry(r, &musb_ep->req_list, list) { list_for_each_entry(r, &musb_ep->req_list, list) {
if (r == request) if (r == req)
break; break;
} }
if (r != request) { if (r != req) {
DBG(3, "request %p not queued to %s\n", request, ep->name); DBG(3, "request %p not queued to %s\n", request, ep->name);
status = -EINVAL; status = -EINVAL;
goto done; goto done;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册