lkml.org 
[lkml]   [2021]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.11 059/775] soc: ti: pm33xx: Fix some resource leak in the error handling paths of the probe function
    Date
    From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

    [ Upstream commit 17ad4662595ea0c4fd7496b664523ef632e63349 ]

    '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>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/soc/ti/pm33xx.c | 5 ++++-
    1 file changed, 4 insertions(+), 1 deletion(-)

    diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c
    index 64f3e31055401..7bab4bbaf02dc 100644
    --- a/drivers/soc/ti/pm33xx.c
    +++ b/drivers/soc/ti/pm33xx.c
    @@ -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();

    @@ -575,6 +575,9 @@ err_pm_runtime_put:
    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;
    --
    2.27.0


    \
     
     \ /
      Last update: 2021-03-02 00:40    [W:2.066 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site