From a027f30d72f2c4d27d6dd9bd053205d3102de7d1 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 8 Dec 2014 16:50:38 +0800 Subject: 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 Signed-off-by: Amos Kong Signed-off-by: Herbert Xu --- include/linux/hw_random.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux/hw_random.h') diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h index c212e71ea886..7832e5008959 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. */ -- cgit v1.2.3-59-g8ed1b