summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Pakki <pakki001@umn.edu>2020-06-13 22:15:25 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-16 08:17:23 +0200
commitcc1815b74b28f044075f724e09516c4169981958 (patch)
tree3d5b71e0557b2e6e6074cfaa2beb2d40864e386a
parent312904ba704b1b33dd83cd3e2c6a17e1afddde62 (diff)
usb: dwc3: pci: Fix reference count leak in dwc3_pci_resume_work
[ Upstream commit 2655971ad4b34e97dd921df16bb0b08db9449df7 ] 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 <pakki001@umn.edu> Signed-off-by: Felipe Balbi <balbi@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/usb/dwc3/dwc3-pci.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index b2fd505938a0..389ec4c689c4 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -204,8 +204,10 @@ static void dwc3_pci_resume_work(struct work_struct *work)
int ret;
ret = pm_runtime_get_sync(&dwc3->dev);
- if (ret)
+ if (ret) {
+ pm_runtime_put_sync_autosuspend(&dwc3->dev);
return;
+ }
pm_runtime_mark_last_busy(&dwc3->dev);
pm_runtime_put_sync_autosuspend(&dwc3->dev);