X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=include%2Fcrypto%2Fscatterwalk.h;h=833d208c25d64194525e8b1ff09d8ddaf261251d;hb=92634825571d86417941855a8e3189c07aa3c706;hp=224658b8d80689560e6ebf7c7bd94c41a2ea76bf;hpb=ef3f2de2b5496f721b12f21a157e19eac816394b;p=~andy%2Flinux diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 224658b8d80..833d208c25d 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h @@ -57,10 +57,14 @@ static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num, struct scatterlist *sg2) { sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0); + sg1[num - 1].page_link &= ~0x02; } 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); }