summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorVitaly Kuzmichev <vkuzmichev@mvista.com>2010-08-13 17:01:06 +0400
committerRemy Bohmer <linux@bohmer.net>2010-09-20 21:57:17 +0200
commitdf559c1d21ba1a9ee0dcec57567907888484d877 (patch)
tree53355a982383c140206e260221ccdce80e6be987 /drivers/usb
parent2e12abe65410bcfa4c6058a8b81231d5d62a323c (diff)
USB-CDC: Correct stat_req initialization
Fix possible oops on stat_req->buf initialization and fix ep0 and status_ep confusion (last one is just intended for stat_req keeping). Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com> Signed-off-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/ether.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 283049ebe62..8126f76861a 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -1726,14 +1726,13 @@ autoconf_fail:
/* ... and maybe likewise for status transfer */
#if defined(DEV_CONFIG_CDC)
if (dev->status_ep) {
- dev->stat_req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL);
- dev->stat_req->buf = status_req;
+ dev->stat_req = usb_ep_alloc_request(dev->status_ep, GFP_KERNEL);
if (!dev->stat_req) {
- dev->stat_req->buf=NULL;
- usb_ep_free_request (gadget->ep0, dev->req);
+ usb_ep_free_request (dev->status_ep, dev->req);
goto fail;
}
+ dev->stat_req->buf = status_req;
dev->stat_req->context = NULL;
}
#endif