powerpc/secvar: fix refcount leak in format_show()
authorHangyu Hua <hbh25y@gmail.com>
Wed, 2 Mar 2022 02:19:59 +0000 (10:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:03:05 +0000 (20:03 +0200)
commitc105ffb6b9744158e37e9f81f0f38861951d1c1f
treeb59e9f7caff914ef0ee152f7a729c5c727a74ece
parent458b7c35fdda3baaa5db4e9b08e2ef67d17a148a
powerpc/secvar: fix refcount leak in format_show()

[ Upstream commit d601fd24e6964967f115f036a840f4f28488f63f ]

Refcount leak will happen when format_show returns failure in multiple
cases. Unified management of of_node_put can fix this problem.

Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220302021959.10959-1-hbh25y@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kernel/secvar-sysfs.c