SG: clear termination bit in sg_chain()
[deliverable/linux.git] / include / linux / scatterlist.h
index 45712317138973ad8147ed0567c30bb4d62da55a..b2ec8421b89f00b7fe20a872462210b1b2c1ca8e 100644 (file)
@@ -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;
 }
 
 /**
This page took 0.029436 seconds and 5 git commands to generate.