]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc: fix unbalanced node refcount in check_kvm_guest()
authorNathan Lynch <nathanl@linux.ibm.com>
Tue, 28 Sep 2021 12:45:50 +0000 (07:45 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 10:04:24 +0000 (11:04 +0100)
commite093b8b68af7c04d4dee770d3adf1d135643e395
tree6971adc92b09baf36147f4c60685e34222565490
parent87557023bcf06d3d515f720d21bb456bca07df36
powerpc: fix unbalanced node refcount in check_kvm_guest()

[ Upstream commit 56537faf8821e361d739fc5ff58c9c40f54a1d4c ]

When check_kvm_guest() succeeds in looking up a /hypervisor OF node, it
returns without performing a matching put for the lookup, leaving the
node's reference count elevated.

Add the necessary call to of_node_put(), rearranging the code slightly to
avoid repetition or goto.

Fixes: 107c55005fbd ("powerpc/pseries: Add KVM guest doorbell restrictions")
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Reviewed-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210928124550.132020-1-nathanl@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kernel/firmware.c