Skip to content

Commit c4579cd

Browse files
YuKuai-huaweigregkh
authored andcommitted
ARM: socfpga: PM: add missing put_device() call in socfpga_setup_ocram_self_refresh()
[ Upstream commit 3ad7b4e ] if of_find_device_by_node() succeed, socfpga_setup_ocram_self_refresh doesn't have a corresponding put_device(). Thus add a jump target to fix the exception handling for this function implementation. Fixes: 44fd8c7 ("ARM: socfpga: support suspend to ram") Signed-off-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3fcd97d commit c4579cd

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • arch/arm/mach-socfpga

arch/arm/mach-socfpga/pm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ static int socfpga_setup_ocram_self_refresh(void)
6060
if (!ocram_pool) {
6161
pr_warn("%s: ocram pool unavailable!\n", __func__);
6262
ret = -ENODEV;
63-
goto put_node;
63+
goto put_device;
6464
}
6565

6666
ocram_base = gen_pool_alloc(ocram_pool, socfpga_sdram_self_refresh_sz);
6767
if (!ocram_base) {
6868
pr_warn("%s: unable to alloc ocram!\n", __func__);
6969
ret = -ENOMEM;
70-
goto put_node;
70+
goto put_device;
7171
}
7272

7373
ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
@@ -78,7 +78,7 @@ static int socfpga_setup_ocram_self_refresh(void)
7878
if (!suspend_ocram_base) {
7979
pr_warn("%s: __arm_ioremap_exec failed!\n", __func__);
8080
ret = -ENOMEM;
81-
goto put_node;
81+
goto put_device;
8282
}
8383

8484
/* Copy the code that puts DDR in self refresh to ocram */
@@ -92,6 +92,8 @@ static int socfpga_setup_ocram_self_refresh(void)
9292
if (!socfpga_sdram_self_refresh_in_ocram)
9393
ret = -EFAULT;
9494

95+
put_device:
96+
put_device(&pdev->dev);
9597
put_node:
9698
of_node_put(np);
9799

0 commit comments

Comments
 (0)