Skip to content

Commit

Permalink
usb: dwc3: pci: Fix pm_runtime_get_sync() error checking
Browse files Browse the repository at this point in the history
[ Upstream commit a03e2dd ]

If the device is already in a runtime PM enabled state
pm_runtime_get_sync() will return 1, so a test for negative
value should be used to check for errors.

Fixes: 8eed00b ("usb: dwc3: pci: Runtime resume child device from wq")
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Link: https://lore.kernel.org/r/20220422062652.10575-1-zhengyongjun3@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Zheng Yongjun authored and gregkh committed Jun 14, 2022
1 parent 8ae4fed commit 2a1bf8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/dwc3-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static void dwc3_pci_resume_work(struct work_struct *work)
int ret;

ret = pm_runtime_get_sync(&dwc3->dev);
if (ret) {
if (ret < 0) {
pm_runtime_put_sync_autosuspend(&dwc3->dev);
return;
}
Expand Down

0 comments on commit 2a1bf8e

Please sign in to comment.