diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 457123171389..b2ec8421b89f 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h @@ -179,7 +179,11 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, #ifndef ARCH_HAS_SG_CHAIN BUG(); #endif - prv[prv_nents - 1].page_link = (unsigned long) sgl | 0x01; + /* + * Set lowest bit to indicate a link pointer, and make sure to clear + * the termination bit if it happens to be set. + */ + prv[prv_nents - 1].page_link = ((unsigned long) sgl | 0x01) & ~0x02; } /**