aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/random.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c
index c7afc068c28d..7c13581ca9cd 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -407,7 +407,7 @@ struct entropy_store {
407 /* read-write data: */ 407 /* read-write data: */
408 spinlock_t lock; 408 spinlock_t lock;
409 unsigned add_ptr; 409 unsigned add_ptr;
410 int entropy_count; /* Must at no time exceed ->POOLBITS! */ 410 int entropy_count;
411 int input_rotate; 411 int input_rotate;
412}; 412};
413 413
@@ -767,11 +767,10 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min,
767{ 767{
768 unsigned long flags; 768 unsigned long flags;
769 769
770 BUG_ON(r->entropy_count > r->poolinfo->POOLBITS);
771
772 /* Hold lock while accounting */ 770 /* Hold lock while accounting */
773 spin_lock_irqsave(&r->lock, flags); 771 spin_lock_irqsave(&r->lock, flags);
774 772
773 BUG_ON(r->entropy_count > r->poolinfo->POOLBITS);
775 DEBUG_ENT("trying to extract %d bits from %s\n", 774 DEBUG_ENT("trying to extract %d bits from %s\n",
776 nbytes * 8, r->name); 775 nbytes * 8, r->name);
777 776