Jelajahi Sumber

Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  [CRYPTO] api: Flush the current page right than the next
  [CRYPTO] api: Use the right value when advancing scatterwalk_copychunks
Linus Torvalds 18 tahun lalu
induk
melakukan
755948cfca
1 mengubah file dengan 6 tambahan dan 2 penghapusan
  1. 6 2
      crypto/scatterwalk.c

+ 6 - 2
crypto/scatterwalk.c

@@ -59,8 +59,12 @@ EXPORT_SYMBOL_GPL(scatterwalk_map);
 static void scatterwalk_pagedone(struct scatter_walk *walk, int out,
 static void scatterwalk_pagedone(struct scatter_walk *walk, int out,
 				 unsigned int more)
 				 unsigned int more)
 {
 {
-	if (out)
-		flush_dcache_page(scatterwalk_page(walk));
+	if (out) {
+		struct page *page;
+
+		page = walk->sg->page + ((walk->offset - 1) >> PAGE_SHIFT);
+		flush_dcache_page(page);
+	}
 
 
 	if (more) {
 	if (more) {
 		walk->offset += PAGE_SIZE - 1;
 		walk->offset += PAGE_SIZE - 1;