[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220906141703.118192-1-zhengyongjun3@huawei.com>
Date: Tue, 6 Sep 2022 14:17:03 +0000
From: Zheng Yongjun <zhengyongjun3@...wei.com>
To: <linuxppc-dev@...ts.ozlabs.org>, <linux-kernel@...r.kernel.org>
CC: <mpe@...erman.id.au>, <npiggin@...il.com>,
<christophe.leroy@...roup.eu>
Subject: [PATCH -next] powerpc/powernv: add missing of_node_put() in opal_export_attrs()
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@...wei.com>
---
arch/powerpc/platforms/powernv/opal.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index 55a8fbfdb5b2..3510b55b36f8 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -892,6 +892,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;
}
--
2.17.1
Powered by blists - more mailing lists