]> git.pld-linux.org Git - packages/kernel.git/blob - linux-2.4-mremap-munmap.patch
- obsolete
[packages/kernel.git] / linux-2.4-mremap-munmap.patch
1 Changes for mm/mremap.c@1.8
2 andrea@de[marcelo]
3 Return proper do_munmap() error code
4
5 --- 1.7/mm/mremap.c     Wed Feb 18 04:53:26 2004
6 +++ 1.8/mm/mremap.c     Wed Feb 18 04:53:26 2004
7 @@ -258,16 +258,20 @@
8                 if ((addr <= new_addr) && (addr+old_len) > new_addr)
9                         goto out;
10  
11 -               do_munmap(current->mm, new_addr, new_len);
12 +               ret = do_munmap(current->mm, new_addr, new_len);
13 +               if (ret && new_len)
14 +                       goto out;
15         }
16  
17         /*
18          * Always allow a shrinking remap: that just unmaps
19          * the unnecessary pages..
20          */
21 -       ret = addr;
22         if (old_len >= new_len) {
23 -               do_munmap(current->mm, addr+new_len, old_len - new_len);
24 +               ret = do_munmap(current->mm, addr+new_len, old_len - new_len);
25 +               if (ret && old_len != new_len)
26 +                       goto out;
27 +               ret = addr;
28                 if (!(flags & MREMAP_FIXED) || (new_addr == addr))
29                         goto out;
30         }
This page took 0.082018 seconds and 3 git commands to generate.