summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/ether.c
diff options
context:
space:
mode:
authorVitaly Kuzmichev <vkuzmichev@mvista.com>2010-08-13 17:00:16 +0400
committerRemy Bohmer <linux@bohmer.net>2010-09-20 21:57:17 +0200
commit0129e327f424f61a9123de44c73fe1082adb3672 (patch)
treef94426fc036b077267f22f06d3d3bdde99888ab1 /drivers/usb/gadget/ether.c
parent7de731859158144cf2abf1de4e79327c8a44baf8 (diff)
downloadu-boot-imx-0129e327f424f61a9123de44c73fe1082adb3672.zip
u-boot-imx-0129e327f424f61a9123de44c73fe1082adb3672.tar.gz
u-boot-imx-0129e327f424f61a9123de44c73fe1082adb3672.tar.bz2
USB-CDC: Correct freeing usb requests
Fix in_ep and out_ep confusion (rx_req was allocated from out_ep, not from in_ep) and add lost dev->req freeing. Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
Diffstat (limited to 'drivers/usb/gadget/ether.c')
-rw-r--r--drivers/usb/gadget/ether.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 5b2f6dd..51f5006 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -836,7 +836,7 @@ static void eth_reset_config (struct eth_dev *dev)
if (dev->out) {
usb_ep_disable (dev->out_ep);
if (dev->rx_req) {
- usb_ep_free_request (dev->in_ep, dev->rx_req);
+ usb_ep_free_request (dev->out_ep, dev->rx_req);
dev->rx_req=NULL;
}
}
@@ -1421,6 +1421,11 @@ static void eth_unbind (struct usb_gadget *gadget)
debug("%s...\n", __func__);
+ /* we've already been disconnected ... no i/o is active */
+ if (dev->req) {
+ usb_ep_free_request (gadget->ep0, dev->req);
+ dev->req = NULL;
+ }
if (dev->stat_req) {
usb_ep_free_request (dev->status_ep, dev->stat_req);
dev->stat_req = NULL;
@@ -1432,7 +1437,7 @@ static void eth_unbind (struct usb_gadget *gadget)
}
if (dev->rx_req) {
- usb_ep_free_request (dev->in_ep, dev->rx_req);
+ usb_ep_free_request (dev->out_ep, dev->rx_req);
dev->rx_req=NULL;
}