Skip to content

Commit

Permalink
usb: gadget: r8a66597-udc: fix error return code in r8a66597_probe()
Browse files Browse the repository at this point in the history
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 <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Wei Yongjun authored and Felipe Balbi committed May 15, 2013
1 parent 48ad20f commit f3423d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/gadget/r8a66597-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f3423d3

Please sign in to comment.