Explorar o código

usb: dwc3: Undo PHY init if soft reset fails

In this function, we init the USB2 and USB3 PHYs, but if soft reset
times out, we don't unwind this.

Noticed by inspection.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Brian Norris %!s(int64=7) %!d(string=hai) anos
pai
achega
00b42170c8
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      drivers/usb/dwc3/core.c

+ 3 - 0
drivers/usb/dwc3/core.c

@@ -234,6 +234,9 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc)
 		udelay(1);
 	} while (--retries);
 
+	phy_exit(dwc->usb3_generic_phy);
+	phy_exit(dwc->usb2_generic_phy);
+
 	return -ETIMEDOUT;
 }