Skip to content

Commit

Permalink
soc: ti: pm33xx: Fix some resource leak in the error handling paths o…
Browse files Browse the repository at this point in the history
…f the probe function

[ Upstream commit 17ad466 ]

'am33xx_pm_rtc_setup()' allocates some resources that must be freed on the
error. Commit 2152fbb ("soc: ti: pm33xx: Simplify RTC usage to prepare
to drop platform data") has introduced the use of these resources but has
only updated the remove function.

Fix the error handling path of the probe function now.

Fixes: 2152fbb ("soc: ti: pm33xx: Simplify RTC usage to prepare to drop platform data")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
tititiou36 authored and gregkh committed Mar 4, 2021
1 parent 6880c7b commit 235182f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/soc/ti/pm33xx.c
Expand Up @@ -535,7 +535,7 @@ static int am33xx_pm_probe(struct platform_device *pdev)

ret = am33xx_push_sram_idle();
if (ret)
goto err_free_sram;
goto err_unsetup_rtc;

am33xx_pm_set_ipc_ops();

Expand Down Expand Up @@ -575,6 +575,9 @@ static int am33xx_pm_probe(struct platform_device *pdev)
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;
Expand Down

0 comments on commit 235182f

Please sign in to comment.