[U-Boot] [PATCH 3/4] usb: ci_udc: fix probe error cleanup

Stephen Warren swarren at wwwdotorg.org
Tue Jun 10 19:02:37 CEST 2014


From: Stephen Warren <swarren at nvidia.com>

If allocation of the ep0 req fails, clean up all the allocations that
were made in ci_udc_probe().

Signed-off-by: Stephen Warren <swarren at nvidia.com>
---
 drivers/usb/gadget/ci_udc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c
index 7a6563f83fd1..1428af85cffd 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;
 	}
-- 
1.8.1.5



More information about the U-Boot mailing list