]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
powerpc/powernv: add missing of_node_put() in opal_export_attrs()
authorZheng Yongjun <zhengyongjun3@huawei.com>
Tue, 6 Sep 2022 14:17:03 +0000 (14:17 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 07:58:02 +0000 (09:58 +0200)
[ 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>
arch/powerpc/platforms/powernv/opal.c

index 55a8fbfdb5b2874c673eb9dce310fbed5e01be2b..3510b55b36f8cec29152031b3e161ceb33171805 100644 (file)
@@ -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;
        }