Skip to contentSkip to conversation

usb: bdc: fix error handling code in bdc_resume

PATCH New Dongliang Mu 1 participant 1 message Nov 30, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: bdc: fix error handling code in bdc_resume

If bdc_reinit in bdc_resume fails, it forgets to deallocate the bdc->clk.

Fix this by adding clk_disable_unprepare(bdc->clk).

---
 drivers/usb/gadget/udc/bdc/bdc_core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/gadget/udc/bdc/bdc_core.c +1 -0
index fa1a3908ec3b..9849e0c86e23 100644
@@ -623,6 +623,7 @@ static int bdc_resume(struct device *dev)
 	ret = bdc_reinit(bdc);
 	if (ret) {
 		dev_err(bdc->dev, "err in bdc reinit\n");
+		clk_disable_unprepare(bdc->clk);
 		return ret;
 	}
 
Signature · 1 line
2.25.1