[U-Boot] [PATCH 4/8] USB-CDC: Correct freeing usb requests
Vitaly Kuzmichev
vkuzmichev at mvista.com
Thu Aug 12 14:44:42 CEST 2010
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 at mvista.com>
---
drivers/usb/gadget/ether.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index b6f5f4d..dd3ab8c 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -845,7 +845,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;
}
}
@@ -1432,6 +1432,11 @@ static void eth_unbind (struct usb_gadget *gadget)
DEBUG (dev, "%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;
@@ -1443,7 +1448,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;
}
--
1.7.1.1
More information about the U-Boot
mailing list