There are memory leaks of usb request and its buffer for ep0,
in_ep, and out ep. Fix memory leaks of usb request and its buffer.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
[sw0312.kim: fix conflict about int_ep from thor_eps_setup()]
Change-Id: I606d039d53847d0e0850c5bcbceca451bdbb1c02
result = usb_ep_enable(ep, d);
if (result)
- goto err;
+ goto err_free_out_req;
ep->driver_data = cdev; /* claim */
return 0;
+ err_free_out_req:
+ usb_ep_free_request(dev->out_ep, dev->out_req);
+ dev->out_req = NULL;
+
err_disable_out_ep:
usb_ep_disable(dev->out_ep);