These error cases have the exact same outcome, so a single return statement can be used. Signed-off-by: Jouni Malinen <j@w1.fi>
@@ -124,9 +124,7 @@ static struct crypto_bignum * sae_get_rand(struct sae_data *sae)
return NULL;
for (;;) {
- if (iter++ > 100)
- return NULL;
- if (random_get_bytes(val, order_len) < 0)
+ if (iter++ > 100 || random_get_bytes(val, order_len) < 0)
if (order_len_bits % 8)
buf_shift_right(val, order_len, 8 - order_len_bits % 8);