summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crypto/lrw.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/crypto/lrw.c b/crypto/lrw.c
index 6fcf0d431185..0430ccd08728 100644
--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -122,10 +122,9 @@ static int next_index(u32 *counter)
int i, res = 0;
for (i = 0; i < 4; i++) {
- if (counter[i] + 1 != 0) {
- res += ffz(counter[i]++);
- break;
- }
+ if (counter[i] + 1 != 0)
+ return res + ffz(counter[i]++);
+
counter[i] = 0;
res += 32;
}