hwrng: fix unregister race.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 8 Dec 2014 08:50:38 +0000 (16:50 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 22 Dec 2014 12:02:40 +0000 (23:02 +1100)
commita027f30d72f2c4d27d6dd9bd053205d3102de7d1
treec430933226d1f44da1cb2aca7c418a9baea8e17b
parent3a2c0ba5ad00c018c0bef39a2224aca950aa33f2
hwrng: fix unregister race.

The previous patch added one potential problem: we can still be
reading from a hwrng when it's unregistered.  Add a wait for zero
in the hwrng_unregister path.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/core.c
include/linux/hw_random.h