Skip to content

Commit

Permalink
soc: ti: pm33xx: Fix refcount leak in am33xx_pm_probe
Browse files Browse the repository at this point in the history
[ Upstream commit 8f3c307 ]

wkup_m3_ipc_get() takes refcount, which should be freed by
wkup_m3_ipc_put(). Add missing refcount release in the error paths.

Fixes: 5a99ae0 ("soc: ti: pm33xx: AM437X: Add rtc_only with ddr in self-refresh support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20230106054022.947529-1-linmq006@gmail.com
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yuuoniy authored and gregkh committed May 11, 2023
1 parent b479543 commit 65305e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/soc/ti/pm33xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ static int am33xx_pm_probe(struct platform_device *pdev)

ret = am33xx_pm_alloc_sram();
if (ret)
return ret;
goto err_wkup_m3_ipc_put;

ret = am33xx_pm_rtc_setup();
if (ret)
Expand Down Expand Up @@ -572,13 +572,14 @@ static int am33xx_pm_probe(struct platform_device *pdev)
pm_runtime_put_sync(dev);
err_pm_runtime_disable:
pm_runtime_disable(dev);
wkup_m3_ipc_put(m3_ipc);
err_unsetup_rtc:
iounmap(rtc_base_virt);
clk_put(rtc_fck);
err_free_sram:
am33xx_pm_free_sram();
pm33xx_dev = NULL;
err_wkup_m3_ipc_put:
wkup_m3_ipc_put(m3_ipc);
return ret;
}

Expand Down

0 comments on commit 65305e8

Please sign in to comment.