]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
HSI: Fix PM usage counter unbalance in ssi_hw_init
authorZhang Qilong <zhangqilong3@huawei.com>
Mon, 23 Nov 2020 10:18:27 +0000 (18:18 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Apr 2021 16:31:28 +0000 (18:31 +0200)
BugLink: https://bugs.launchpad.net/bugs/1918974
[ Upstream commit aa57e77b3d28f0df07149d88c47bc0f3aa77330b ]

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: b209e047bc743 ("HSI: Introduce OMAP SSI driver")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/hsi/controllers/omap_ssi_core.c

index 2be9c01e175ca9f2f7172a337e45b36f81e9507d..f36036be7f03288d76a7741850cb33f47f05eafb 100644 (file)
@@ -424,7 +424,7 @@ static int ssi_hw_init(struct hsi_controller *ssi)
        struct omap_ssi_controller *omap_ssi = hsi_controller_drvdata(ssi);
        int err;
 
-       err = pm_runtime_get_sync(ssi->device.parent);
+       err = pm_runtime_resume_and_get(ssi->device.parent);
        if (err < 0) {
                dev_err(&ssi->device, "runtime PM failed %d\n", err);
                return err;