]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader
authorMiaoqian Lin <linmq006@gmail.com>
Fri, 3 Jun 2022 12:15:42 +0000 (16:15 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:24:13 +0000 (14:24 +0200)
[ Upstream commit 75f435eb04a58f44c9bc0fc80f4e5b25cdc64065 ]

of_find_node_by_path() returns remote device nodepointer with
refcount incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.

Fixes: ea5362f56619 ("[POWERPC] spufs: allow isolated mode apps by starting the SPE loader")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220603121543.22884-1-linmq006@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/platforms/cell/spufs/inode.c

index bed05b644c2c548693dc43a43260450fe699d4cd..ed37a93bf858a7a197c4220f6e017b38a45c0998 100644 (file)
@@ -659,6 +659,7 @@ spufs_init_isolated_loader(void)
                return;
 
        loader = of_get_property(dn, "loader", &size);
+       of_node_put(dn);
        if (!loader)
                return;