Commit 53c3f63e authored by Matt Mackall's avatar Matt Mackall Committed by Linus Torvalds

random: reuse rand_initialize

Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 43ae4860
...@@ -899,7 +899,7 @@ static void init_std_data(struct entropy_store *r) ...@@ -899,7 +899,7 @@ static void init_std_data(struct entropy_store *r)
sizeof(*(utsname()))/4); sizeof(*(utsname()))/4);
} }
static int __init rand_initialize(void) static int rand_initialize(void)
{ {
init_std_data(&input_pool); init_std_data(&input_pool);
init_std_data(&blocking_pool); init_std_data(&blocking_pool);
...@@ -1101,9 +1101,7 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg) ...@@ -1101,9 +1101,7 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
/* Clear the entropy pool counters. */ /* Clear the entropy pool counters. */
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
init_std_data(&input_pool); rand_initialize();
init_std_data(&blocking_pool);
init_std_data(&nonblocking_pool);
return 0; return 0;
default: default:
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment