Skip to content

Commit 97ab388

Browse files
Bixuan Cuismb49
authored andcommitted
usb: core: hub: Fix PM reference leak in usb_port_resume()
BugLink: https://bugs.launchpad.net/bugs/1928825 [ Upstream commit 025f97d ] 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/20210408130831.56239-1-cuibixuan@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent b8ad115 commit 97ab388

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/core/hub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3570,7 +3570,7 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
35703570
u16 portchange, portstatus;
35713571

35723572
if (!test_and_set_bit(port1, hub->child_usage_bits)) {
3573-
status = pm_runtime_get_sync(&port_dev->dev);
3573+
status = pm_runtime_resume_and_get(&port_dev->dev);
35743574
if (status < 0) {
35753575
dev_dbg(&udev->dev, "can't resume usb port, status %d\n",
35763576
status);

0 commit comments

Comments
 (0)