Skip to content

Commit

Permalink
crypto: skcipher - remove unnecessary setting of walk->nbytes
Browse files Browse the repository at this point in the history
Setting 'walk->nbytes = walk->total' in skcipher_walk_first() doesn't
make sense because actually walk->nbytes needs to be set to the length
of the first step in the walk, which may be less than walk->total.  This
is done by skcipher_walk_next() which is called immediately afterwards.
Also walk->nbytes was already set to 0 in skcipher_walk_skcipher(),
which is a better default value in case it's forgotten to be set later.

Therefore, remove the unnecessary assignment to walk->nbytes.

Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ebiggers authored and herbertx committed Aug 3, 2018
1 parent 3dd8cc0 commit 2a57c0b
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion crypto/skcipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ static int skcipher_walk_first(struct skcipher_walk *walk)
}

walk->page = NULL;
walk->nbytes = walk->total;

return skcipher_walk_next(walk);
}
Expand Down

0 comments on commit 2a57c0b

Please sign in to comment.