]> git.baikalelectronics.ru Git - kernel.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)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 8 Sep 2022 04:22:47 +0000 (14:22 +1000)
After using 'np' returned by of_find_node_by_path(), of_node_put()
need be called to decrease the refcount.

Fixes: 48409f391e78 ("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
arch/powerpc/platforms/powernv/opal.c

index e536a6a3c801704882a123bf9a7830d5a6f79eaf..cdf3838f08d3762406e3880b82b3f7da0255989f 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;
        }