mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: bdc: fix error handling code in bdc_resume
@ 2021-11-30 14:33 Dongliang Mu
  0 siblings, 0 replies; only message in thread
From: Dongliang Mu @ 2021-11-30 14:33 UTC (permalink / raw)
  To: Al Cooper, Felipe Balbi, Greg Kroah-Hartman
  Cc: Dongliang Mu, linux-usb, bcm-kernel-feedback-list, linux-kernel

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

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

Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
---
 drivers/usb/gadget/udc/bdc/bdc_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
index fa1a3908ec3b..9849e0c86e23 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_core.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
@@ -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;
 	}
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-30 14:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30 14:33 [PATCH] usb: bdc: fix error handling code in bdc_resume Dongliang Mu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®