aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/random.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 3823cb2e3b9a..a754132336ba 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -457,7 +457,7 @@ static void __add_entropy_words(struct entropy_store *r, const __u32 *in,
457 unsigned long i, add_ptr, tap1, tap2, tap3, tap4, tap5; 457 unsigned long i, add_ptr, tap1, tap2, tap3, tap4, tap5;
458 int input_rotate; 458 int input_rotate;
459 int wordmask = r->poolinfo->poolwords - 1; 459 int wordmask = r->poolinfo->poolwords - 1;
460 __u32 w, next_w; 460 __u32 w;
461 unsigned long flags; 461 unsigned long flags;
462 462
463 /* Taps are constant, so we can load them without holding r->lock. */ 463 /* Taps are constant, so we can load them without holding r->lock. */
@@ -466,17 +466,13 @@ static void __add_entropy_words(struct entropy_store *r, const __u32 *in,
466 tap3 = r->poolinfo->tap3; 466 tap3 = r->poolinfo->tap3;
467 tap4 = r->poolinfo->tap4; 467 tap4 = r->poolinfo->tap4;
468 tap5 = r->poolinfo->tap5; 468 tap5 = r->poolinfo->tap5;
469 next_w = *in++;
470 469
471 spin_lock_irqsave(&r->lock, flags); 470 spin_lock_irqsave(&r->lock, flags);
472 prefetch_range(r->pool, wordmask);
473 input_rotate = r->input_rotate; 471 input_rotate = r->input_rotate;
474 add_ptr = r->add_ptr; 472 add_ptr = r->add_ptr;
475 473
476 while (nwords--) { 474 while (nwords--) {
477 w = rol32(next_w, input_rotate & 31); 475 w = rol32(*in++, input_rotate & 31);
478 if (nwords > 0)
479 next_w = *in++;
480 i = add_ptr = (add_ptr - 1) & wordmask; 476 i = add_ptr = (add_ptr - 1) & wordmask;
481 477
482 /* XOR in the various taps */ 478 /* XOR in the various taps */