From: Wei Yongjun Date: Tue, 7 May 2013 11:49:08 +0000 (+0800) Subject: usb: gadget: m66592-udc: fix error return code in m66592_probe() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ef89a1f3a84d127bdcda7e4dd54f763d2f88203f;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git usb: gadget: m66592-udc: fix error return code in m66592_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/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c index 866ef0999247..51cfe72da5bb 100644 --- a/drivers/usb/gadget/m66592-udc.c +++ b/drivers/usb/gadget/m66592-udc.c @@ -1660,8 +1660,10 @@ static int __init m66592_probe(struct platform_device *pdev) m66592->epaddr2ep[0] = &m66592->ep[0]; m66592->ep0_req = m66592_alloc_request(&m66592->ep[0].ep, GFP_KERNEL); - if (m66592->ep0_req == NULL) + if (m66592->ep0_req == NULL) { + ret = -ENOMEM; goto clean_up3; + } m66592->ep0_req->complete = nop_completion; init_controller(m66592);