diff mbox series

usb: musb: fix reference leak in musb_irq_work

Message ID 20201030154646.98852-1-zhangqilong3@huawei.com (mailing list archive)
State Superseded
Headers show
Series usb: musb: fix reference leak in musb_irq_work | expand

Commit Message

Zhang Qilong Oct. 30, 2020, 3:46 p.m. UTC
pm_runtime_get_sync() will increment pm usage counter even it
failed. Forgetting to call pm_runtime_put_noidle will result
in reference leak in musb_irq_work, so we should fix it.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/usb/musb/musb_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 849e0b770130..160387de59c0 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2069,7 +2069,7 @@  static void musb_irq_work(struct work_struct *data)
 	error = pm_runtime_get_sync(musb->controller);
 	if (error < 0) {
 		dev_err(musb->controller, "Could not enable: %i\n", error);
-
+		pm_runtime_put_noidle(musb->controller);
 		return;
 	}