]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ARM: imx5: add missing put_device() call in imx_suspend_alloc_ocram()
authoryu kuai <yukuai3@huawei.com>
Thu, 4 Jun 2020 12:42:06 +0000 (20:42 +0800)
committerShawn Guo <shawnguo@kernel.org>
Wed, 24 Jun 2020 01:24:34 +0000 (09:24 +0800)
if of_find_device_by_node() succeed, imx_suspend_alloc_ocram() doesn't
have a corresponding put_device(). Thus add a jump target to fix the
exception handling for this function implementation.

Fixes: 1579c7b9fe01 ("ARM: imx53: Set DDR pins to high impedance when in suspend to RAM.")
Signed-off-by: yu kuai <yukuai3@huawei.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm/mach-imx/pm-imx5.c

index f057df813f83acafc8ad9a469bbe6fa08e9ed7f8..e9962b48e30cbd2db797cf9bb452b452ca93dfe3 100644 (file)
@@ -295,14 +295,14 @@ static int __init imx_suspend_alloc_ocram(
        if (!ocram_pool) {
                pr_warn("%s: ocram pool unavailable!\n", __func__);
                ret = -ENODEV;
-               goto put_node;
+               goto put_device;
        }
 
        ocram_base = gen_pool_alloc(ocram_pool, size);
        if (!ocram_base) {
                pr_warn("%s: unable to alloc ocram!\n", __func__);
                ret = -ENOMEM;
-               goto put_node;
+               goto put_device;
        }
 
        phys = gen_pool_virt_to_phys(ocram_pool, ocram_base);
@@ -312,6 +312,8 @@ static int __init imx_suspend_alloc_ocram(
        if (virt_out)
                *virt_out = virt;
 
+put_device:
+       put_device(&pdev->dev);
 put_node:
        of_node_put(node);