Skip to content

Commit 4845446

Browse files
YuKuai-huaweiShawn Guo
authored andcommitted
ARM: imx6: add missing put_device() call in imx6q_suspend_init()
if of_find_device_by_node() succeed, imx6q_suspend_init() doesn't have a corresponding put_device(). Thus add a jump target to fix the exception handling for this function implementation. Signed-off-by: yu kuai <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent 586745f commit 4845446

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

arch/arm/mach-imx/pm-imx6.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,14 +493,14 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
493493
if (!ocram_pool) {
494494
pr_warn("%s: ocram pool unavailable!\n", __func__);
495495
ret = -ENODEV;
496-
goto put_node;
496+
goto put_device;
497497
}
498498

499499
ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE);
500500
if (!ocram_base) {
501501
pr_warn("%s: unable to alloc ocram!\n", __func__);
502502
ret = -ENOMEM;
503-
goto put_node;
503+
goto put_device;
504504
}
505505

506506
ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
@@ -523,7 +523,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
523523
ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat);
524524
if (ret) {
525525
pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret);
526-
goto put_node;
526+
goto put_device;
527527
}
528528

529529
ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat);
@@ -570,7 +570,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
570570
&imx6_suspend,
571571
MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info));
572572

573-
goto put_node;
573+
goto put_device;
574574

575575
pl310_cache_map_failed:
576576
iounmap(pm_info->gpc_base.vbase);
@@ -580,6 +580,8 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
580580
iounmap(pm_info->src_base.vbase);
581581
src_map_failed:
582582
iounmap(pm_info->mmdc_base.vbase);
583+
put_device:
584+
put_device(&pdev->dev);
583585
put_node:
584586
of_node_put(node);
585587

0 commit comments

Comments
 (0)