Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/pseries: Fix missing of_node_put() in rng_init()

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

authored by

Nicholas Mc Guire and committed by
Michael Ellerman
67c3e594 d012a719

+1
+1
arch/powerpc/platforms/pseries/rng.c
··· 36 36 37 37 ppc_md.get_random_seed = pseries_get_random_long; 38 38 39 + of_node_put(dn); 39 40 return 0; 40 41 } 41 42 machine_subsys_initcall(pseries, rng_init);