net/mlx4_en: Fix mixed PFC and Global pause user control requests
[pandora-kernel.git] / crypto / scatterwalk.c
index 41e529a..8b59699 100644 (file)
@@ -68,7 +68,8 @@ static void scatterwalk_pagedone(struct scatter_walk *walk, int out,
 
 void scatterwalk_done(struct scatter_walk *walk, int out, int more)
 {
-       if (!(scatterwalk_pagelen(walk) & (PAGE_SIZE - 1)) || !more)
+       if (!more || walk->offset >= walk->sg->offset + walk->sg->length ||
+           !(walk->offset & (PAGE_SIZE - 1)))
                scatterwalk_pagedone(walk, out, more);
 }
 EXPORT_SYMBOL_GPL(scatterwalk_done);