From: Wei Yongjun Date: Tue, 7 May 2013 11:48:50 +0000 (+0800) Subject: usb: gadget: r8a66597-udc: fix error return code in r8a66597_probe() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=f3423d3258cd9939c06df75a582b16d52fc2249f;p=openwrt%2Fstaging%2Fblogic.git usb: gadget: r8a66597-udc: fix error return code in r8a66597_probe() Fix to return -ENOMEM in the request alloc error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index 0b742d171843..7ff7d9cf2061 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c @@ -1977,8 +1977,10 @@ static int __init r8a66597_probe(struct platform_device *pdev) r8a66597->ep0_req = r8a66597_alloc_request(&r8a66597->ep[0].ep, GFP_KERNEL); - if (r8a66597->ep0_req == NULL) + if (r8a66597->ep0_req == NULL) { + ret = -ENOMEM; goto clean_up3; + } r8a66597->ep0_req->complete = nop_completion; ret = usb_add_gadget_udc(&pdev->dev, &r8a66597->gadget);