Skip to content

Commit 8f3c307

Browse files
Yuuoniynmenon
authored andcommitted
soc: ti: pm33xx: Fix refcount leak in am33xx_pm_probe
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Nishanth Menon <[email protected]>
1 parent 5f1732a commit 8f3c307

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/soc/ti/pm33xx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ static int am33xx_pm_probe(struct platform_device *pdev)
527527

528528
ret = am33xx_pm_alloc_sram();
529529
if (ret)
530-
return ret;
530+
goto err_wkup_m3_ipc_put;
531531

532532
ret = am33xx_pm_rtc_setup();
533533
if (ret)
@@ -572,13 +572,14 @@ static int am33xx_pm_probe(struct platform_device *pdev)
572572
pm_runtime_put_sync(dev);
573573
err_pm_runtime_disable:
574574
pm_runtime_disable(dev);
575-
wkup_m3_ipc_put(m3_ipc);
576575
err_unsetup_rtc:
577576
iounmap(rtc_base_virt);
578577
clk_put(rtc_fck);
579578
err_free_sram:
580579
am33xx_pm_free_sram();
581580
pm33xx_dev = NULL;
581+
err_wkup_m3_ipc_put:
582+
wkup_m3_ipc_put(m3_ipc);
582583
return ret;
583584
}
584585

0 commit comments

Comments
 (0)