Skip to content

Commit

Permalink
powerpc/pseries: Fix missing of_node_put() in rng_init()
Browse files Browse the repository at this point in the history
[ Upstream commit 67c3e59 ]

The call to of_find_compatible_node() returns a node pointer with
refcount incremented thus it must be explicitly decremented here
before returning.

Fixes: a489043 ("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>
  • Loading branch information
Nicholas Mc Guire authored and gregkh committed Oct 29, 2020
1 parent bcbeec5 commit cc86827
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/platforms/pseries/rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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);

0 comments on commit cc86827

Please sign in to comment.