aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/random.c')
-rw-r--r--drivers/char/random.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c
index a38d97a21455..0894d86253fd 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -724,6 +724,8 @@ struct timer_rand_state {
724 unsigned dont_count_entropy:1; 724 unsigned dont_count_entropy:1;
725}; 725};
726 726
727#define INIT_TIMER_RAND_STATE { INITIAL_JIFFIES, };
728
727/* 729/*
728 * Add device- or boot-specific data to the input and nonblocking 730 * Add device- or boot-specific data to the input and nonblocking
729 * pools to help initialize them to unique values. 731 * pools to help initialize them to unique values.
@@ -750,7 +752,7 @@ void add_device_randomness(const void *buf, unsigned int size)
750} 752}
751EXPORT_SYMBOL(add_device_randomness); 753EXPORT_SYMBOL(add_device_randomness);
752 754
753static struct timer_rand_state input_timer_state; 755static struct timer_rand_state input_timer_state = INIT_TIMER_RAND_STATE;
754 756
755/* 757/*
756 * This function adds entropy to the entropy "pool" by using timing 758 * This function adds entropy to the entropy "pool" by using timing
@@ -1267,8 +1269,10 @@ void rand_initialize_disk(struct gendisk *disk)
1267 * source. 1269 * source.
1268 */ 1270 */
1269 state = kzalloc(sizeof(struct timer_rand_state), GFP_KERNEL); 1271 state = kzalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
1270 if (state) 1272 if (state) {
1273 state->last_time = INITIAL_JIFFIES;
1271 disk->random = state; 1274 disk->random = state;
1275 }
1272} 1276}
1273#endif 1277#endif
1274 1278