usb: dwc3: gadget: avoid memory leak when failing to allocate all eps
authorDavid Cohen <david.a.cohen@linux.intel.com>
Thu, 12 Sep 2013 00:42:47 +0000 (17:42 -0700)
committerFelipe Balbi <balbi@ti.com>
Tue, 17 Sep 2013 16:05:01 +0000 (11:05 -0500)
commite1f804676a95b9d5caaa3a822d90bc1101595468
treec48ac2f81d78af981ea2415b4a6dc10178956c6d
parentbbaa7c81e61e339fbc6aae2594c7ce8f54196fa7
usb: dwc3: gadget: avoid memory leak when failing to allocate all eps

If dwc3_gadget_init_endpoint() fails after allocate some of the eps, we
need to free their memory to avoid leak.

Signed-off-by: David Cohen <david.a.cohen@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/gadget.c