From: Brian Norris Date: Wed, 17 Jan 2018 21:22:49 +0000 (-0800) Subject: usb: dwc3: Undo PHY init if soft reset fails X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e8f101ec20c09be9f8635ac053bd2a5dff22482c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git usb: dwc3: Undo PHY init if soft reset fails [ Upstream commit 00b42170c86f90ac9dea83a7dfcd3f0c38098fe2 ] 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 Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index c3f3f1a89b0f..280b9ae0a25c 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -248,6 +248,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; }