diff options
| author | Wen Yang <wen.yang99@zte.com.cn> | 2019-03-05 06:32:56 -0500 |
|---|---|---|
| committer | Heiko Stuebner <heiko@sntech.de> | 2019-04-23 13:52:37 -0400 |
| commit | fbd7af041586a15f5dc15b9ec051d25aa5ebe00a (patch) | |
| tree | b31b0482f4e999e9926c44263624e8fd7d803a36 | |
| parent | 2dd00d31d488707d0c60088aeb41b6bc2450a7b2 (diff) | |
ARM: rockchip: add missing of_node_put in rockchip_smp_prepare_pmu
The call to of_get_next_child returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last
usage.
Detected by coccinelle with the following warnings:
./arch/arm/mach-rockchip/platsmp.c:250:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 241, but without a corresponding object release within this function.
./arch/arm/mach-rockchip/platsmp.c:260:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 241, but without a corresponding object release within this function.
./arch/arm/mach-rockchip/platsmp.c:263:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 241, but without a corresponding object release within this function.
Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
| -rw-r--r-- | arch/arm/mach-rockchip/platsmp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c index 51984a40b097..4675d9202000 100644 --- a/arch/arm/mach-rockchip/platsmp.c +++ b/arch/arm/mach-rockchip/platsmp.c | |||
| @@ -245,6 +245,7 @@ static int __init rockchip_smp_prepare_pmu(void) | |||
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | pmu_base = of_iomap(node, 0); | 247 | pmu_base = of_iomap(node, 0); |
| 248 | of_node_put(node); | ||
| 248 | if (!pmu_base) { | 249 | if (!pmu_base) { |
| 249 | pr_err("%s: could not map pmu registers\n", __func__); | 250 | pr_err("%s: could not map pmu registers\n", __func__); |
| 250 | return -ENOMEM; | 251 | return -ENOMEM; |
