Skip to contentSkip to conversation

usb: cdns3 fixes on usb-next

PATCH New Peter Chen 1 participant 2 messages May 14

Subsystems (2)
lore
Share & tools
lore

Peter Chen

author
#0 lore raw

cover usb: cdns3 fixes on usb-next

One fix reported by [email protected].

Peter Chen (1):
usb: cdns3: plat: fix leaked role switch on core role initialization
failure

 drivers/usb/cdns3/cdns3-plat.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.50.1
author
#1 lore raw

PATCH 1/1 usb: cdns3: plat: fix leaked role switch on core role initialization failure

Calling usb_role_switch_unregister if core role initialization failure.

---
 drivers/usb/cdns3/cdns3-plat.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/usb/cdns3/cdns3-plat.c +4 -1
index 3fe3109a3688..91159910fe95 100644
@@ -167,7 +167,7 @@ static int cdns3_plat_probe(struct platform_device *pdev)
 	cdns->host_init = cdns3_plat_host_init;
 	ret = cdns_core_init_role(cdns);
 	if (ret)
-		goto err_cdns_init;
+		goto err_cdns_init_role;
 
 	device_set_wakeup_capable(dev, true);
 	pm_runtime_set_active(dev);
@@ -186,6 +186,9 @@ static int cdns3_plat_probe(struct platform_device *pdev)
 
 	return 0;
 
+err_cdns_init_role:
+	if (cdns->role_sw)
+		usb_role_switch_unregister(cdns->role_sw);
 err_cdns_init:
 	set_phy_power_off(cdns);
 err_phy_power_on:
Signature · 1 line
2.50.1