summaryrefslogtreecommitdiffstats
path: root/sys/dev/random/randomdev_soft.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/random/randomdev_soft.c')
-rw-r--r--sys/dev/random/randomdev_soft.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/random/randomdev_soft.c b/sys/dev/random/randomdev_soft.c
index 3f5fb5d..5847022 100644
--- a/sys/dev/random/randomdev_soft.c
+++ b/sys/dev/random/randomdev_soft.c
@@ -301,6 +301,12 @@ random_harvest_internal(u_int64_t somecounter, const void *entropy,
{
struct harvest *event;
+ KASSERT(origin == RANDOM_START || origin == RANDOM_WRITE ||
+ origin == RANDOM_KEYBOARD || origin == RANDOM_MOUSE ||
+ origin == RANDOM_NET || origin == RANDOM_INTERRUPT ||
+ origin == RANDOM_PURE || origin == ENTROPYSOURCE,
+ ("random_harvest_internal: origin %d invalid\n", origin));
+
/* Lockless read to avoid lock operations if fifo is full. */
if (harvestfifo[origin].count >= RANDOM_FIFO_MAX)
return;
OpenPOWER on IntegriCloud