Commit 32528d0f authored by Herbert Xu's avatar Herbert Xu

[CRYPTO] blkcipher: Fix inverted test in blkcipher_get_spot

The previous patch had the conditional inverted.  This patch fixes it
so that we return the original position if it does not straddle a page.

Thanks to Bob Gilligan for spotting this.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e4630f9f
...@@ -65,7 +65,7 @@ static inline void blkcipher_unmap_dst(struct blkcipher_walk *walk) ...@@ -65,7 +65,7 @@ static inline void blkcipher_unmap_dst(struct blkcipher_walk *walk)
static inline u8 *blkcipher_get_spot(u8 *start, unsigned int len) static inline u8 *blkcipher_get_spot(u8 *start, unsigned int len)
{ {
u8 *end_page = (u8 *)(((unsigned long)(start + len - 1)) & PAGE_MASK); u8 *end_page = (u8 *)(((unsigned long)(start + len - 1)) & PAGE_MASK);
return start < end_page ? start : end_page; return start > end_page ? start : end_page;
} }
static inline unsigned int blkcipher_done_slow(struct crypto_blkcipher *tfm, static inline unsigned int blkcipher_done_slow(struct crypto_blkcipher *tfm,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment