Title: [6183] trunk/mm/nommu.c: Fix bug [#4948], the trail page is not be protected cause shm not work with MPU.
Revision
6183
Author
gyang
Date
2009-03-17 03:40:45 -0500 (Tue, 17 Mar 2009)

Log Message

Fix bug [#4948], the trail page is not be protected cause shm not work with MPU.

Modified Paths

Diff

Modified: trunk/mm/nommu.c (6182 => 6183)


--- trunk/mm/nommu.c	2009-03-17 06:06:39 UTC (rev 6182)
+++ trunk/mm/nommu.c	2009-03-17 08:40:45 UTC (rev 6183)
@@ -430,12 +430,12 @@
 	long len = vma->vm_end - vma->vm_start;
 
 #ifdef CONFIG_MPU
-	while (len > 0) {
-		len -= PAGE_SIZE;
-		protect_page(mm, vma->vm_start + len, 0);
+	long start = vma->vm_start;
+	while (start < vma->vm_end) {
+		protect_page(mm, start, vma->vm_flags);
+		start += PAGE_SIZE;
 	}
 	update_protections(mm);
-	len = vma->vm_end - vma->vm_start;
 #endif
 
 	if (vma->vm_flags & VM_SPLIT_PAGES)
@@ -460,10 +460,10 @@
 	struct vm_area_struct *vma = vml->vma;
 
 #ifdef CONFIG_MPU
-	long len = vma->vm_end - vma->vm_start;
-	while (len > 0) {
-		len -= PAGE_SIZE;
-		protect_page(mm, vma->vm_start + len, vma->vm_flags);
+	long start = vma->vm_start;
+	while (start < vma->vm_end) {
+		protect_page(mm, start, vma->vm_flags);
+		start += PAGE_SIZE;
 	}
 	update_protections(mm);
 #endif
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to