]> git.sur5r.net Git - u-boot/commitdiff
usb: ci_udc: fix probe error cleanup
authorStephen Warren <swarren@nvidia.com>
Tue, 10 Jun 2014 17:02:37 +0000 (11:02 -0600)
committerMarek Vasut <marex@denx.de>
Wed, 11 Jun 2014 00:26:05 +0000 (02:26 +0200)
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@nvidia.com>
drivers/usb/gadget/ci_udc.c

index 7a6563f83fd1d5e42c3d5f7d3a0eb2fd774c3ba6..1428af85cffdb2644994ea2270e98eceeeb9f67a 100644 (file)
@@ -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;
        }