Skip to content

Commit

Permalink
crypto: scatterwalk - Use sg_chain_ptr on chain entries
Browse files Browse the repository at this point in the history
commit 389a539 upstream.

Now that scatterwalk_sg_chain sets the chain pointer bit the sg_page
call in scatterwalk_sg_next hits a BUG_ON when CONFIG_DEBUG_SG is
enabled. Use sg_chain_ptr instead of sg_page on a chain entry.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Tom Lendacky authored and Greg Kroah-Hartman committed Dec 12, 2013
1 parent 97b054c commit 012228e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/crypto/scatterwalk.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg)
if (sg_is_last(sg))
return NULL;

return (++sg)->length ? sg : (void *)sg_page(sg);
return (++sg)->length ? sg : sg_chain_ptr(sg);
}

static inline void scatterwalk_crypto_chain(struct scatterlist *head,
Expand Down

0 comments on commit 012228e

Please sign in to comment.