summaryrefslogtreecommitdiffstats
path: root/sys/dev/random
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2005-03-29 11:08:45 +0000
committermarkm <markm@FreeBSD.org>2005-03-29 11:08:45 +0000
commit9e31cd39931afa615aa9ff3f91635a0f22e38651 (patch)
treebe929a53a50c52aa5479ab3abdbde83f9b4b7b9c /sys/dev/random
parentbcbda3d7711e59c7e798039ab3be0daa4de9977a (diff)
downloadFreeBSD-src-9e31cd39931afa615aa9ff3f91635a0f22e38651.zip
FreeBSD-src-9e31cd39931afa615aa9ff3f91635a0f22e38651.tar.gz
Revert to the more correct array size, and correct a KASSERT to
only allow proper values. ENTROPYSOURCE is a maxval+1, not an allowable number. Suggested loose protons in the solution: phk Prefers to keep the pH close to seven: markm
Diffstat (limited to 'sys/dev/random')
-rw-r--r--sys/dev/random/randomdev_soft.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/random/randomdev_soft.c b/sys/dev/random/randomdev_soft.c
index 87f13af..4d109a7 100644
--- a/sys/dev/random/randomdev_soft.c
+++ b/sys/dev/random/randomdev_soft.c
@@ -90,7 +90,7 @@ static struct entropyfifo emptyfifo;
#define EMPTYBUFFERS 1024
/* Harvested entropy */
-static struct entropyfifo harvestfifo[ENTROPYSOURCE + 1];
+static struct entropyfifo harvestfifo[ENTROPYSOURCE];
/* <0 to end the kthread, 0 to let it run */
static int random_kthread_control = 0;
@@ -302,7 +302,7 @@ random_harvest_internal(u_int64_t somecounter, const void *entropy,
KASSERT(origin == RANDOM_START || origin == RANDOM_WRITE ||
origin == RANDOM_KEYBOARD || origin == RANDOM_MOUSE ||
origin == RANDOM_NET || origin == RANDOM_INTERRUPT ||
- origin == RANDOM_PURE || origin == ENTROPYSOURCE,
+ origin == RANDOM_PURE,
("random_harvest_internal: origin %d invalid\n", origin));
/* Lockless read to avoid lock operations if fifo is full. */
OpenPOWER on IntegriCloud