]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: skcipher - remove redundant clamping to page size
authorEric Biggers <ebiggers@google.com>
Sun, 5 Jan 2025 19:34:11 +0000 (11:34 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 14 Jan 2025 03:38:32 +0000 (11:38 +0800)
commita22a2316be227f8d85a6c8abe4bd568bfeb0233c
tree993796f3ee89f02283c5403047db4c75fb4c4bf0
parent807c8018f5c90b10e172caf3858999cf3754fe7f
crypto: skcipher - remove redundant clamping to page size

In the case where skcipher_walk_next() allocates a bounce page, that
page by definition has size PAGE_SIZE.  The number of bytes to copy 'n'
is guaranteed to fit in it, since earlier in the function it was clamped
to be at most a page.  Therefore remove the unnecessary logic that tried
to clamp 'n' again to fit in the bounce page.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/skcipher.c