lkml.org 
[lkml]   [2020]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] usb: musb: fix reference count leak in musb_irq_work
Date
musb_irq_work() calls pm_runtime_get_sync() that increments
the reference counter. In case of failure, decrement the reference
count and return the error.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
drivers/usb/musb/musb_core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 384a8039a7fd..fd36a026bef0 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2070,6 +2070,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_autosuspend(musb->controller);

return;
}
--
2.25.1
\
 
 \ /
  Last update: 2020-06-14 05:28    [W:0.046 / U:2.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site