Skip to content

Commit 3ad7b4e

Browse files
YuKuai-huaweiDinh Nguyen
authored andcommitted
ARM: socfpga: PM: add missing put_device() call in socfpga_setup_ocram_self_refresh()
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 <[email protected]> Signed-off-by: Dinh Nguyen <[email protected]>
1 parent 812f550 commit 3ad7b4e

File tree

1 file changed

+5
-3
lines changed
  • arch/arm/mach-socfpga

1 file changed

+5
-3
lines changed

arch/arm/mach-socfpga/pm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ static int socfpga_setup_ocram_self_refresh(void)
4949
if (!ocram_pool) {
5050
pr_warn("%s: ocram pool unavailable!\n", __func__);
5151
ret = -ENODEV;
52-
goto put_node;
52+
goto put_device;
5353
}
5454

5555
ocram_base = gen_pool_alloc(ocram_pool, socfpga_sdram_self_refresh_sz);
5656
if (!ocram_base) {
5757
pr_warn("%s: unable to alloc ocram!\n", __func__);
5858
ret = -ENOMEM;
59-
goto put_node;
59+
goto put_device;
6060
}
6161

6262
ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
@@ -67,7 +67,7 @@ static int socfpga_setup_ocram_self_refresh(void)
6767
if (!suspend_ocram_base) {
6868
pr_warn("%s: __arm_ioremap_exec failed!\n", __func__);
6969
ret = -ENOMEM;
70-
goto put_node;
70+
goto put_device;
7171
}
7272

7373
/* Copy the code that puts DDR in self refresh to ocram */
@@ -81,6 +81,8 @@ static int socfpga_setup_ocram_self_refresh(void)
8181
if (!socfpga_sdram_self_refresh_in_ocram)
8282
ret = -EFAULT;
8383

84+
put_device:
85+
put_device(&pdev->dev);
8486
put_node:
8587
of_node_put(np);
8688

0 commit comments

Comments
 (0)