summaryrefslogtreecommitdiff
path: root/random/jitterentropy-noise.c
diff options
context:
space:
mode:
Diffstat (limited to 'random/jitterentropy-noise.c')
-rw-r--r--random/jitterentropy-noise.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/random/jitterentropy-noise.c b/random/jitterentropy-noise.c
index 75443a8f..9cb1b39f 100644
--- a/random/jitterentropy-noise.c
+++ b/random/jitterentropy-noise.c
@@ -189,17 +189,19 @@ static void jent_memaccess(struct rand_data *ec, uint64_t loop_cnt)
uint32_t u[4];
uint8_t b[sizeof(uint32_t) * 4];
} prngState = { .u = {0x8e93eec0, 0xce65608a, 0xa8d46b46, 0xe83cef69} };
- uint32_t addressMask = ec->memmask;
+ uint32_t addressMask;
uint64_t acc_loop_cnt;
+ if (NULL == ec || NULL == ec->mem)
+ return;
+
+ addressMask = ec->memmask;
+
/* Ensure that macros cannot overflow jent_loop_shuffle() */
BUILD_BUG_ON((MAX_ACC_LOOP_BIT + MIN_ACC_LOOP_BIT) > 63);
acc_loop_cnt =
jent_loop_shuffle(ec, MAX_ACC_LOOP_BIT, MIN_ACC_LOOP_BIT);
- if (NULL == ec || NULL == ec->mem)
- return;
-
/*
* Mix the current data into prngState
*