]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge tag 'v5.3-rockchip-soc32-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorOlof Johansson <olof@lixom.net>
Mon, 17 Jun 2019 12:14:24 +0000 (05:14 -0700)
committerOlof Johansson <olof@lixom.net>
Mon, 17 Jun 2019 12:14:24 +0000 (05:14 -0700)
Another missing of_node_put

* tag 'v5.3-rockchip-soc32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  ARM: rockchip: fix missing of_node_put calls in smp code

Signed-off-by: Olof Johansson <olof@lixom.net>
1  2 
arch/arm/mach-rockchip/platsmp.c
arch/arm/mach-rockchip/pm.c

index 909fffee024044f2dc0475dca18d67db694eb5e3,afd15147fdd4ed94e1e90fa25c80ecbc5e3ba5d5..649e0a54784cd75b4a94779d9646cf6fdd60cbcc
@@@ -1,7 -1,16 +1,7 @@@
 +// SPDX-License-Identifier: GPL-2.0-or-later
  /*
   * Copyright (c) 2013 MundoReader S.L.
   * Author: Heiko Stuebner <heiko@sntech.de>
 - *
 - * This program is free software; you can redistribute it and/or modify
 - * it under the terms of the GNU General Public License as published by
 - * the Free Software Foundation; either version 2 of the License, or
 - * (at your option) any later version.
 - *
 - * This program is distributed in the hope that it will be useful,
 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 - * GNU General Public License for more details.
   */
  
  #include <linux/delay.h>
@@@ -269,19 -278,25 +269,25 @@@ static void __init rockchip_smp_prepare
        sram_base_addr = of_iomap(node, 0);
        if (!sram_base_addr) {
                pr_err("%s: could not map sram registers\n", __func__);
+               of_node_put(node);
                return;
        }
  
-       if (has_pmu && rockchip_smp_prepare_pmu())
+       if (has_pmu && rockchip_smp_prepare_pmu()) {
+               of_node_put(node);
                return;
+       }
  
        if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
-               if (rockchip_smp_prepare_sram(node))
+               if (rockchip_smp_prepare_sram(node)) {
+                       of_node_put(node);
                        return;
+               }
  
                /* enable the SCU power domain */
                pmu_set_power_domain(PMU_PWRDN_SCU, true);
  
+               of_node_put(node);
                node = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
                if (!node) {
                        pr_err("%s: missing scu\n", __func__);
                scu_base_addr = of_iomap(node, 0);
                if (!scu_base_addr) {
                        pr_err("%s: could not map scu registers\n", __func__);
+                       of_node_put(node);
                        return;
                }
  
                asm ("mrc p15, 1, %0, c9, c0, 2\n" : "=r" (l2ctlr));
                ncores = ((l2ctlr >> 24) & 0x3) + 1;
        }
+       of_node_put(node);
  
        /* Make sure that all cores except the first are really off */
        for (i = 1; i < ncores; i++)
index 744b5b332e42e138dfe65566504feaab968b6592,4a4f914c34cf8a3f7290a186fe3a36141ea53bcb..87389d9456b95c30fc0730df589310d0c2523005
@@@ -1,7 -1,16 +1,7 @@@
 +// SPDX-License-Identifier: GPL-2.0-only
  /*
   * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
   * Author: Tony Xie <tony.xie@rock-chips.com>
 - *
 - * This program is free software; you can redistribute it and/or modify it
 - * under the terms and conditions of the GNU General Public License,
 - * version 2, as published by the Free Software Foundation.
 - *
 - * This program is distributed in the hope it will be useful, but WITHOUT
 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 - * more details.
 - *
   */
  
  #include <linux/init.h>
@@@ -257,12 -266,14 +257,14 @@@ static int __init rk3288_suspend_init(s
        rk3288_bootram_base = of_iomap(sram_np, 0);
        if (!rk3288_bootram_base) {
                pr_err("%s: could not map bootram base\n", __func__);
+               of_node_put(sram_np);
                return -ENOMEM;
        }
  
        ret = of_address_to_resource(sram_np, 0, &res);
        if (ret) {
                pr_err("%s: could not get bootram phy addr\n", __func__);
+               of_node_put(sram_np);
                return ret;
        }
        rk3288_bootram_phy = res.start;