diff options
author | Seung-Woo Kim <sw0312.kim@samsung.com> | 2018-06-04 15:53:39 +0900 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2018-08-08 22:22:07 +0200 |
commit | c194bdf226030e45bcb2db3dcbb2d72e5052820a (patch) | |
tree | 8ad62c6ce056bda70d4c1211d7cb0e34b3aca846 /drivers | |
parent | b1aad8dbe28415695b290726199681ced969c118 (diff) |
gadget: f_thor: fix hang-up with ctrl-c
After the commit 6aae84769a0b ("gadget: f_thor: Fix memory leaks of
usb request and its buffer"), there is hang-up with ctrl-c in some
udc. It is because req of out_ep is freed before out_ep is disabled.
Fix hang-up with ctrl-c by disabling ep before free req of the ep.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/f_thor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c index 1aa6be44bb..8b3b19feaf 100644 --- a/drivers/usb/gadget/f_thor.c +++ b/drivers/usb/gadget/f_thor.c @@ -877,14 +877,14 @@ static void thor_func_disable(struct usb_function *f) /* Avoid freeing memory when ep is still claimed */ if (dev->in_ep->driver_data) { - free_ep_req(dev->in_ep, dev->in_req); usb_ep_disable(dev->in_ep); + free_ep_req(dev->in_ep, dev->in_req); dev->in_ep->driver_data = NULL; } if (dev->out_ep->driver_data) { - usb_ep_free_request(dev->out_ep, dev->out_req); usb_ep_disable(dev->out_ep); + usb_ep_free_request(dev->out_ep, dev->out_req); dev->out_ep->driver_data = NULL; } |