aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/random.h
diff options
context:
space:
mode:
authorTobin C. Harding <me@tobin.cc>2018-06-22 09:15:32 +1000
committerTheodore Ts'o <tytso@mit.edu>2018-07-17 21:32:48 -0400
commit753d433b586d1d43c487e3d660f5778c7c8d58ea (patch)
tree7f1a030f66811359e8c12c7e4d3668564d919684 /include/linux/random.h
parentrandom: Fix whitespace pre random-bytes work (diff)
downloadwireguard-linux-753d433b586d1d43c487e3d660f5778c7c8d58ea.tar.xz
wireguard-linux-753d433b586d1d43c487e3d660f5778c7c8d58ea.zip
random: Return nbytes filled from hw RNG
Currently the function get_random_bytes_arch() has return value 'void'. If the hw RNG fails we currently fall back to using get_random_bytes(). This defeats the purpose of requesting random material from the hw RNG in the first place. There are currently no intree users of get_random_bytes_arch(). Only get random bytes from the hw RNG, make function return the number of bytes retrieved from the hw RNG. Acked-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/linux/random.h')
-rw-r--r--include/linux/random.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/random.h b/include/linux/random.h
index 2ddf13b4281e..f1c9bc5cd231 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -38,7 +38,7 @@ extern void get_random_bytes(void *buf, int nbytes);
extern int wait_for_random_bytes(void);
extern int add_random_ready_callback(struct random_ready_callback *rdy);
extern void del_random_ready_callback(struct random_ready_callback *rdy);
-extern void get_random_bytes_arch(void *buf, int nbytes);
+extern int __must_check get_random_bytes_arch(void *buf, int nbytes);
#ifndef MODULE
extern const struct file_operations random_fops, urandom_fops;