Commit 85c6201a80ce4464a52c58a5f5ea8de15a557a6f
Committed by
Herbert Xu
1 parent
3385329a0a
Exists in
master
and in
39 other branches
crypto: scatterwalk - Fix scatterwalk_done() test
We are done with the scattergather entry when the walk offset goes past sg->offset + sg->length, not when it crosses a page boundary. There is a similarly queer test in the second half of scatterwalk_pagedone() that probably needs some scrutiny. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
crypto/scatterwalk.c
... | ... | @@ -68,7 +68,7 @@ |
68 | 68 | |
69 | 69 | void scatterwalk_done(struct scatter_walk *walk, int out, int more) |
70 | 70 | { |
71 | - if (!offset_in_page(walk->offset) || !more) | |
71 | + if (!(scatterwalk_pagelen(walk) & (PAGE_SIZE - 1)) || !more) | |
72 | 72 | scatterwalk_pagedone(walk, out, more); |
73 | 73 | } |
74 | 74 | EXPORT_SYMBOL_GPL(scatterwalk_done); |