Commit 50211e77 authored by yu kuai's avatar yu kuai Committed by Kelsey Skunberg

ARM: imx5: add missing put_device() call in imx_suspend_alloc_ocram()

BugLink: https://bugs.launchpad.net/bugs/1885932

[ Upstream commit 586745f1 ]

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: 1579c7b9 ("ARM: imx53: Set DDR pins to high impedance when in suspend to RAM.")
Signed-off-by: default avataryu kuai <yukuai3@huawei.com>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent 9f987008
...@@ -301,14 +301,14 @@ static int __init imx_suspend_alloc_ocram( ...@@ -301,14 +301,14 @@ static int __init imx_suspend_alloc_ocram(
if (!ocram_pool) { if (!ocram_pool) {
pr_warn("%s: ocram pool unavailable!\n", __func__); pr_warn("%s: ocram pool unavailable!\n", __func__);
ret = -ENODEV; ret = -ENODEV;
goto put_node; goto put_device;
} }
ocram_base = gen_pool_alloc(ocram_pool, size); ocram_base = gen_pool_alloc(ocram_pool, size);
if (!ocram_base) { if (!ocram_base) {
pr_warn("%s: unable to alloc ocram!\n", __func__); pr_warn("%s: unable to alloc ocram!\n", __func__);
ret = -ENOMEM; ret = -ENOMEM;
goto put_node; goto put_device;
} }
phys = gen_pool_virt_to_phys(ocram_pool, ocram_base); phys = gen_pool_virt_to_phys(ocram_pool, ocram_base);
...@@ -318,6 +318,8 @@ static int __init imx_suspend_alloc_ocram( ...@@ -318,6 +318,8 @@ static int __init imx_suspend_alloc_ocram(
if (virt_out) if (virt_out)
*virt_out = virt; *virt_out = virt;
put_device:
put_device(&pdev->dev);
put_node: put_node:
of_node_put(node); of_node_put(node);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment