From: Stephen Warren Date: Tue, 10 Jun 2014 17:02:37 +0000 (-0600) Subject: usb: ci_udc: fix probe error cleanup X-Git-Tag: submit/tizen/20140613.130021~67^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a7d34be13a6934e0fddfaf12236d8784343f902;p=platform%2Fkernel%2Fu-boot.git usb: ci_udc: fix probe error cleanup If allocation of the ep0 req fails, clean up all the allocations that were made in ci_udc_probe(). Signed-off-by: Stephen Warren --- diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c index 7a6563f..1428af8 100644 --- a/drivers/usb/gadget/ci_udc.c +++ b/drivers/usb/gadget/ci_udc.c @@ -826,6 +826,7 @@ static int ci_udc_probe(void) ci_ep_alloc_request(&controller.ep[0].ep, 0); if (!controller.ep0_req) { + free(controller.items_mem); free(controller.epts); return -ENOMEM; }