From: Tom Lendacky Date: Thu, 5 Dec 2013 19:09:53 +0000 (-0600) Subject: crypto: scatterwalk - Use sg_chain_ptr on chain entries X-Git-Tag: v3.2.54~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c91c0aefd4430b87534794e2c3481e7b476e51b;p=people%2Fms%2Flinux.git crypto: scatterwalk - Use sg_chain_ptr on chain entries commit 389a5390583a18e45bc4abd4439291abec5e7a63 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 Signed-off-by: Herbert Xu Signed-off-by: Ben Hutchings --- diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 672647665a51..0532279203af 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h @@ -66,7 +66,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,