summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Mc Guire <hofrat@osadl.org>2018-07-02 11:08:16 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-29 09:03:05 +0100
commitac3d24dee8e618085df66abc5edeb7a5f4c5d864 (patch)
treeb974e7d947617d94a61646601db984d3b0a1be76
parentde0034fdfd84c056691c0c6cee424749b945e75c (diff)
downloadlinux-stable-ac3d24dee8e618085df66abc5edeb7a5f4c5d864.tar.gz
linux-stable-ac3d24dee8e618085df66abc5edeb7a5f4c5d864.tar.bz2
linux-stable-ac3d24dee8e618085df66abc5edeb7a5f4c5d864.zip
powerpc/pseries: Fix missing of_node_put() in rng_init()
[ Upstream commit 67c3e59443f5fc77be39e2ce0db75fbfa78c7965 ] The call to of_find_compatible_node() returns a node pointer with refcount incremented thus it must be explicitly decremented here before returning. Fixes: a489043f4626 ("powerpc/pseries: Implement arch_get_random_long() based on H_RANDOM") Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/1530522496-14816-1-git-send-email-hofrat@osadl.org Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--arch/powerpc/platforms/pseries/rng.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/rng.c b/arch/powerpc/platforms/pseries/rng.c
index 31ca557af60b..262b8c5e1b9d 100644
--- a/arch/powerpc/platforms/pseries/rng.c
+++ b/arch/powerpc/platforms/pseries/rng.c
@@ -40,6 +40,7 @@ static __init int rng_init(void)
ppc_md.get_random_seed = pseries_get_random_long;
+ of_node_put(dn);
return 0;
}
machine_subsys_initcall(pseries, rng_init);