Skip to content

Commit 8771039

Browse files
zhangqilonggregkh
authored andcommitted
usb: xhci: tegra:Fix PM usage reference leak of tegra_xusb_unpowergate_partitions
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: 41a7426 ("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>
1 parent 71d471e commit 8771039

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/usb/host/xhci-tegra.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,13 +1034,13 @@ static int tegra_xusb_unpowergate_partitions(struct tegra_xusb *tegra)
10341034
int rc;
10351035

10361036
if (tegra->use_genpd) {
1037-
rc = pm_runtime_get_sync(tegra->genpd_dev_ss);
1037+
rc = pm_runtime_resume_and_get(tegra->genpd_dev_ss);
10381038
if (rc < 0) {
10391039
dev_err(dev, "failed to enable XUSB SS partition\n");
10401040
return rc;
10411041
}
10421042

1043-
rc = pm_runtime_get_sync(tegra->genpd_dev_host);
1043+
rc = pm_runtime_resume_and_get(tegra->genpd_dev_host);
10441044
if (rc < 0) {
10451045
dev_err(dev, "failed to enable XUSB Host partition\n");
10461046
pm_runtime_put_sync(tegra->genpd_dev_ss);

0 commit comments

Comments
 (0)