]> asedeno.scripts.mit.edu Git - linux.git/commit
hwrng: core - Clean up RNG list when last hwrng is unregistered
authorGary R Hook <gary.hook@amd.com>
Fri, 15 Dec 2017 19:55:59 +0000 (13:55 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 22 Dec 2017 09:03:36 +0000 (20:03 +1100)
commit0e4b52942b1c76f89e0dcb829f72e123d0678f54
treee7d0865a5ff09837efbba4ca00596312c1277166
parent871df319bd48acb4ce48b8985136c8ba40af3a02
hwrng: core - Clean up RNG list when last hwrng is unregistered

Commit 142a27f0a731 added support for a "best" RNG, and in doing so
introduced a hang from rmmod/modprobe -r when the last RNG on the list
was unloaded.

When the hwrng list is depleted, return the global variables to their
original state and decrement all references to the object.

Fixes: 142a27f0a731 ("hwrng: core - Reset user selected rng by writing "" to rng_current")
Signed-off-by: Gary R Hook <gary.hook@amd.com>
Reviewed-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/core.c