usb: xhci: tegra:Fix PM usage reference leak of tegra_xusb_unpowergate_partitions
authorzhangqilong <zhangqilong3@huawei.com>
Sat, 19 Mar 2022 02:38:22 +0000 (10:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 07:14:27 +0000 (09:14 +0200)
commit576b40690e91dca50ec753c515a8a7fbb1a58849
tree583e824c9e557196d20fb51312366936d1c55395
parent4ebf2982db15f3756dab6f5962995015ff082e5e
usb: xhci: tegra:Fix PM usage reference leak of tegra_xusb_unpowergate_partitions

commit 8771039482d965bdc8cefd972bcabac2b76944a8 upstream.

pm_runtime_get_sync will increment pm usage counter
even it failed. Forgetting to putting operation will
result in reference leak here. We fix it by replacing
it with pm_runtime_resume_and_get to keep usage counter
balanced.

Fixes: 41a7426d25fa ("usb: xhci: tegra: Unlink power domain devices")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20220319023822.145641-1-zhangqilong3@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-tegra.c