X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=crypto%2Fansi_cprng.c;h=666f1962a160f5d547579b918b6229de0232607b;hb=4a2f8a5c16b0828bf3ec89b4ce290bda5a0547de;hp=c0bb3778f1ae06976fbaf07c7e1b075fc0c581e7;hpb=96680d2b9174668100824d763382240c71baa811;p=karo-tx-linux.git diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index c0bb3778f1ae..666f1962a160 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c @@ -230,11 +230,11 @@ remainder: */ if (byte_count < DEFAULT_BLK_SZ) { empty_rbuf: - for (; ctx->rand_data_valid < DEFAULT_BLK_SZ; - ctx->rand_data_valid++) { + while (ctx->rand_data_valid < DEFAULT_BLK_SZ) { *ptr = ctx->rand_data[ctx->rand_data_valid]; ptr++; byte_count--; + ctx->rand_data_valid++; if (byte_count == 0) goto done; }