]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: cpu_ops: fix a leaked reference by adding missing of_node_put
authorWen Yang <wen.yang99@zte.com.cn>
Tue, 5 Mar 2019 11:34:05 +0000 (19:34 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:45:12 +0000 (06:45 -0700)
commit685f8804590f74aa1d7008e662c397e4b41c4003
tree324c01f6741a407e5d29d01eaf81945955acdfa7
parent244c8859b32b3b84b79fc3846c995a157b61d15b
arm64: cpu_ops: fix a leaked reference by adding missing of_node_put

[ Upstream commit 92606ec9285fb84cd9b5943df23f07d741384bfc ]

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/arm64/kernel/cpu_ops.c:102:1-7: ERROR: missing of_node_put;
  acquired a node pointer with refcount incremented on line 69, but
  without a corresponding object release within this function.

Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/kernel/cpu_ops.c