summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZheng Yongjun <zhengyongjun3@huawei.com>2022-09-06 14:17:03 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-10-26 13:19:35 +0200
commitcfd2e41d81cdeac4a0da40f096b99952479c8481 (patch)
treed3fd83a24809daa378b8ecab5a08dde868a79dba
parent904fb4e1b504041de20d0e7286cc40bf0b905389 (diff)
downloadlinux-stable-cfd2e41d81cdeac4a0da40f096b99952479c8481.tar.gz
linux-stable-cfd2e41d81cdeac4a0da40f096b99952479c8481.tar.bz2
linux-stable-cfd2e41d81cdeac4a0da40f096b99952479c8481.zip
powerpc/powernv: add missing of_node_put() in opal_export_attrs()
[ Upstream commit 71a92e99c47900cc164620948b3863382cec4f1a ] After using 'np' returned by of_find_node_by_path(), of_node_put() need be called to decrease the refcount. Fixes: 11fe909d2362 ("powerpc/powernv: Add OPAL exports attributes to sysfs") Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220906141703.118192-1-zhengyongjun3@huawei.com Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--arch/powerpc/platforms/powernv/opal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index edf9032e2e5c..96a3d23132ba 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -740,6 +740,7 @@ static void opal_export_attrs(void)
kobj = kobject_create_and_add("exports", opal_kobj);
if (!kobj) {
pr_warn("kobject_create_and_add() of exports failed\n");
+ of_node_put(np);
return;
}