mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 00:24:12 +08:00
usb: core: hub: Fix PM reference leak in usb_port_resume()
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>
This commit is contained in:
parent
9535b99533
commit
025f97d188
@ -3605,7 +3605,7 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
|
||||
u16 portchange, portstatus;
|
||||
|
||||
if (!test_and_set_bit(port1, hub->child_usage_bits)) {
|
||||
status = pm_runtime_get_sync(&port_dev->dev);
|
||||
status = pm_runtime_resume_and_get(&port_dev->dev);
|
||||
if (status < 0) {
|
||||
dev_dbg(&udev->dev, "can't resume usb port, status %d\n",
|
||||
status);
|
||||
|
Loading…
Reference in New Issue
Block a user