powerpc/secvar: fix refcount leak in format_show()
authorHangyu Hua <hbh25y@gmail.com>
Wed, 2 Mar 2022 02:19:59 +0000 (10:19 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 8 Mar 2022 11:07:41 +0000 (22:07 +1100)
commitd601fd24e6964967f115f036a840f4f28488f63f
tree953ba129dedf8f0729262d9f12666547e3092d43
parent1a76e520ee1831a81dabf8a9a58c6453f700026e
powerpc/secvar: fix refcount leak in format_show()

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
arch/powerpc/kernel/secvar-sysfs.c