lkml.org 
[lkml]   [2002]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [patch] make mprotect() work again
David Mosberger wrote:
>
> This patch:
>
> ChangeSet@1.536.31.4, 2002-09-17 20:35:47-07:00, akpm@digeo.com
> [PATCH] consolidate the VMA splitting code
>
> broke mprotect(). The patch below makes it work again.
>

Thanks. Yet another victim of the return-from-the-middle-of-a-function
disease.

I'll send this:


--- 2.5.38/mm/mprotect.c~mprotect-fix Wed Sep 25 16:16:14 2002
+++ 2.5.38-akpm/mm/mprotect.c Wed Sep 25 16:16:35 2002
@@ -187,7 +187,7 @@ mprotect_fixup(struct vm_area_struct *vm
* Try to merge with the previous vma.
*/
if (mprotect_attempt_merge(vma, *pprev, end, newflags))
- return 0;
+ goto success;
} else {
error = split_vma(mm, vma, start, 1);
if (error)
@@ -209,7 +209,7 @@ mprotect_fixup(struct vm_area_struct *vm
vma->vm_flags = newflags;
vma->vm_page_prot = newprot;
spin_unlock(&mm->page_table_lock);
-
+success:
change_protection(vma, start, end, newprot);
return 0;

.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.175 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site