aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/usb/musb/musb_core.c
diff options
context:
space:
mode:
authorBixuan Cui <cuibixuan@huawei.com>2021-04-08 17:18:36 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-09 16:02:44 +0200
commit9535b99533904e9bc1607575aa8e9539a55435d7 (patch)
treebcc21045eeafc1e797bc1eaa9904521775734a3b /drivers/usb/musb/musb_core.c
parentusb: gadget: tegra-xudc: Fix possible use-after-free in tegra_xudc_remove() (diff)
downloadwireguard-linux-9535b99533904e9bc1607575aa8e9539a55435d7.tar.xz
wireguard-linux-9535b99533904e9bc1607575aa8e9539a55435d7.zip
usb: musb: fix PM reference leak in musb_irq_work()
pm_runtime_get_sync will increment pm usage counter even it failed. thus a pairing decrement is needed. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Bixuan Cui <cuibixuan@huawei.com> Link: https://lore.kernel.org/r/20210408091836.55227-1-cuibixuan@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/musb/musb_core.c')
-rw-r--r--drivers/usb/musb/musb_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index fc0457db62e1..8f09a387b773 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2070,7 +2070,7 @@ static void musb_irq_work(struct work_struct *data)
struct musb *musb = container_of(data, struct musb, irq_work.work);
int error;
- error = pm_runtime_get_sync(musb->controller);
+ error = pm_runtime_resume_and_get(musb->controller);
if (error < 0) {
dev_err(musb->controller, "Could not enable: %i\n", error);