summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2023-01-06 09:40:22 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-11 23:03:07 +0900
commit6dbcc493a18dd60947c2168a39df0ec2fe7b5110 (patch)
treefcdc5e1172575fb9d3734304837bff5375f76372 /drivers/soc
parentf5222fbd797e8506c57f84a036b331cae83ab268 (diff)
downloadlinux-stable-6dbcc493a18dd60947c2168a39df0ec2fe7b5110.tar.gz
linux-stable-6dbcc493a18dd60947c2168a39df0ec2fe7b5110.tar.bz2
linux-stable-6dbcc493a18dd60947c2168a39df0ec2fe7b5110.zip
soc: ti: pm33xx: Fix refcount leak in am33xx_pm_probe
[ Upstream commit 8f3c307b580a4a6425896007325bddefc36e8d91 ] wkup_m3_ipc_get() takes refcount, which should be freed by wkup_m3_ipc_put(). Add missing refcount release in the error paths. Fixes: 5a99ae0092fe ("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>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/ti/pm33xx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c
index ce09c42eaed2..f04c21157904 100644
--- a/drivers/soc/ti/pm33xx.c
+++ b/drivers/soc/ti/pm33xx.c
@@ -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)
@@ -572,13 +572,14 @@ err_pm_runtime_put:
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;
}