[PATCH 4/4] usb: dwc2: fix error path with missing dwc2_drd_exit

Amelie Delaunay amelie.delaunay at st.com
Fri Jul 24 08:37:48 EDT 2020


In case of failure, role switch has to be unregistered. It is done by
dwc2_drd_exit.

Fixes: bc0f0d4a5853 ("usb: dwc2: override PHY input signals with usb role switch support")
Reported-by: kernel test robot <lkp at intel.com>
Signed-off-by: Amelie Delaunay <amelie.delaunay at st.com>
---
 drivers/usb/dwc2/platform.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 68b56b43a45e..f4a0371c3e89 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -600,6 +600,8 @@ static int dwc2_driver_probe(struct platform_device *dev)
 	return 0;
 
 error_init:
+	dwc2_drd_exit(hsotg);
+
 	if (hsotg->params.activate_stm_id_vb_detection)
 		regulator_disable(hsotg->usb33d);
 error:
-- 
2.17.1




More information about the linux-arm-kernel mailing list