summaryrefslogtreecommitdiffstats
path: root/include/linux/hw_random.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2014-12-08 16:50:38 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2014-12-22 23:02:40 +1100
commita027f30d72f2c4d27d6dd9bd053205d3102de7d1 (patch)
treec430933226d1f44da1cb2aca7c418a9baea8e17b /include/linux/hw_random.h
parent3a2c0ba5ad00c018c0bef39a2224aca950aa33f2 (diff)
downloadop-kernel-dev-a027f30d72f2c4d27d6dd9bd053205d3102de7d1.zip
op-kernel-dev-a027f30d72f2c4d27d6dd9bd053205d3102de7d1.tar.gz
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>
Diffstat (limited to 'include/linux/hw_random.h')
-rw-r--r--include/linux/hw_random.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h
index c212e71..7832e50 100644
--- a/include/linux/hw_random.h
+++ b/include/linux/hw_random.h
@@ -46,6 +46,7 @@ struct hwrng {
/* internal. */
struct list_head list;
struct kref ref;
+ bool cleanup_done;
};
/** Register a new Hardware Random Number Generator driver. */
OpenPOWER on IntegriCloud