summaryrefslogtreecommitdiff
path: root/crypto/ansi_cprng.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2013-12-10 10:22:40 +0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-12-10 10:22:40 +0400
commit5d43889c07bb38694742936aa70d1187c012e198 (patch)
tree73809dddae39ae3b746396e9779142dbd1973f33 /crypto/ansi_cprng.c
parent95f75e91588afecfb0090988393653d21f5d1f91 (diff)
parent374b105797c3d4f29c685f3be535c35f5689b30e (diff)
downloadlinux-5d43889c07bb38694742936aa70d1187c012e198.tar.xz
Merge tag 'v3.13-rc3' into for-linus
Merging with the mainline to sync up on changes to serio core.
Diffstat (limited to 'crypto/ansi_cprng.c')
-rw-r--r--crypto/ansi_cprng.c4
1 files changed, 2 insertions, 2 deletions
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;
}