Skip to content

Commit 2655971

Browse files
Aditya Pakkifelipebalbi
authored andcommitted
usb: dwc3: pci: Fix reference count leak in dwc3_pci_resume_work
dwc3_pci_resume_work() calls pm_runtime_get_sync() that increments the reference counter. In case of failure, decrement the reference before returning. Signed-off-by: Aditya Pakki <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 2587a02 commit 2655971

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/usb/dwc3/dwc3-pci.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,10 @@ static void dwc3_pci_resume_work(struct work_struct *work)
206206
int ret;
207207

208208
ret = pm_runtime_get_sync(&dwc3->dev);
209-
if (ret)
209+
if (ret) {
210+
pm_runtime_put_sync_autosuspend(&dwc3->dev);
210211
return;
212+
}
211213

212214
pm_runtime_mark_last_busy(&dwc3->dev);
213215
pm_runtime_put_sync_autosuspend(&dwc3->dev);

0 commit comments

Comments
 (0)