diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2025-04-23 09:36:39 +0800 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2025-04-23 09:36:39 +0800 |
| commit | e3f08b262573187b9c10c61467e97a87bd7c661b (patch) | |
| tree | f910f2ff1709ca20f51746066d255ab4042d43e0 /crypto/scompress.c | |
| parent | bb9c648b334be581a791c7669abaa594e4b5ebb7 (diff) | |
| parent | 8006aff15516a170640239c5a8e6696c0ba18d8e (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Merge crypto tree to pick up scompress off-by-one patch. The
merge resolution is non-trivial as the dst handling code has been
moved in front of the src.
Diffstat (limited to 'crypto/scompress.c')
| -rw-r--r-- | crypto/scompress.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/scompress.c b/crypto/scompress.c index f7ce29b4cdb8..8db4613150e0 100644 --- a/crypto/scompress.c +++ b/crypto/scompress.c @@ -202,8 +202,8 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir) dpage = nth_page(dpage, doff / PAGE_SIZE); doff = offset_in_page(doff); - n = dlen / PAGE_SIZE; - n += (offset_in_page(dlen) + doff - 1) / PAGE_SIZE; + n = (dlen - 1) / PAGE_SIZE; + n += (offset_in_page(dlen - 1) + doff) / PAGE_SIZE; if (PageHighMem(dpage + n) && size_add(doff, dlen) > PAGE_SIZE) return -ENOSYS; @@ -224,8 +224,8 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir) spage = nth_page(spage, soff / PAGE_SIZE); soff = offset_in_page(soff); - n = slen / PAGE_SIZE; - n += (offset_in_page(slen) + soff - 1) / PAGE_SIZE; + n = (slen - 1) / PAGE_SIZE; + n += (offset_in_page(slen - 1) + soff) / PAGE_SIZE; if (PageHighMem(nth_page(spage, n)) && size_add(soff, slen) > PAGE_SIZE) break; |