Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: ti: pm33xx: Fix some resource leak in the error handling paths of the probe function

'am33xx_pm_rtc_setup()' allocates some resources that must be freed on the
error. Commit 2152fbbd47c0 ("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: 2152fbbd47c0 ("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>

authored by

Christophe JAILLET and committed by
Santosh Shilimkar
17ad4662 a88f66d4

+4 -1
+4 -1
drivers/soc/ti/pm33xx.c
··· 535 535 536 536 ret = am33xx_push_sram_idle(); 537 537 if (ret) 538 - goto err_free_sram; 538 + goto err_unsetup_rtc; 539 539 540 540 am33xx_pm_set_ipc_ops(); 541 541 ··· 575 575 err_pm_runtime_disable: 576 576 pm_runtime_disable(dev); 577 577 wkup_m3_ipc_put(m3_ipc); 578 + err_unsetup_rtc: 579 + iounmap(rtc_base_virt); 580 + clk_put(rtc_fck); 578 581 err_free_sram: 579 582 am33xx_pm_free_sram(); 580 583 pm33xx_dev = NULL;