]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: hisilicon: fix refercence leak in xhci_histb_probe
authorZhang Qilong <zhangqilong3@huawei.com>
Fri, 6 Nov 2020 12:22:21 +0000 (20:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Nov 2020 13:32:43 +0000 (14:32 +0100)
commit854fc823c745febe451af5ca32a17d666daa94be
treec8eb2a562a100522d55c67e67b6c1df9d12fabef
parent192f0626781a731a61ba030a52030e8ff7e1162e
xhci: hisilicon: fix refercence leak in xhci_histb_probe

pm_runtime_get_sync() will increment pm usage at first and it
will resume the device later. We should decrease the usage count
whetever it succeeded or failed(maybe runtime of the device has
error, or device is in inaccessible state, or other error state).
If we do not call put operation to decrease the reference, it will
result in reference leak in xhci_histb_probe. Moreover, this
device cannot enter the idle state and always stay busy or other
non-idle state later. So we fixed it by jumping to error handling
branch.

Fixes: bff4f02132c2c ("xhci: hisilicon: support HiSilicon STB xHCI host controller")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20201106122221.2304528-1-zhangqilong3@huawei.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-histb.c