From: Gregory Herrero Date: Tue, 29 Sep 2015 10:08:21 +0000 (+0200) Subject: usb: dwc2: gadget: abort core init if core_reset fails X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=86de48953653777fd6f918f5c0f2107bb873eae3;p=deliverable%2Flinux.git usb: dwc2: gadget: abort core init if core_reset fails No point of continue with initialization if core is not in a sane state. Signed-off-by: Gregory Herrero Signed-off-by: Mian Yousaf Kaukab Tested-by: Robert Baldyga Tested-by: Dinh Nguyen Tested-by: John Youn Acked-by: John Youn Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 1a216c51bbe4..af4f0c165d05 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -2287,7 +2287,8 @@ void dwc2_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg, u32 val; if (!is_usb_reset) - dwc2_hsotg_corereset(hsotg); + if (dwc2_hsotg_corereset(hsotg)) + return; /* * we must now enable ep0 ready for host detection and then