summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/usermode-sources/files/usermode-sources-2.4.24.munmap.patch')
-rw-r--r--sys-kernel/usermode-sources/files/usermode-sources-2.4.24.munmap.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/sys-kernel/usermode-sources/files/usermode-sources-2.4.24.munmap.patch b/sys-kernel/usermode-sources/files/usermode-sources-2.4.24.munmap.patch
new file mode 100644
index 000000000000..e120b35b7adb
--- /dev/null
+++ b/sys-kernel/usermode-sources/files/usermode-sources-2.4.24.munmap.patch
@@ -0,0 +1,27 @@
+diff -ur linux-2.4.25-rc3/mm/mremap.c linux-2.4.25-rc4/mm/mremap.c
+--- linux-2.4.25-rc3/mm/mremap.c 2004-02-18 13:56:01.000000000 +0000
++++ linux-2.4.25-rc4/mm/mremap.c 2004-02-18 13:49:08.000000000 +0000
+@@ -258,16 +258,20 @@
+ if ((addr <= new_addr) && (addr+old_len) > new_addr)
+ goto out;
+
+- do_munmap(current->mm, new_addr, new_len);
++ ret = do_munmap(current->mm, new_addr, new_len);
++ if (ret && new_len)
++ goto out;
+ }
+
+ /*
+ * Always allow a shrinking remap: that just unmaps
+ * the unnecessary pages..
+ */
+- ret = addr;
+ if (old_len >= new_len) {
+- do_munmap(current->mm, addr+new_len, old_len - new_len);
++ ret = do_munmap(current->mm, addr+new_len, old_len - new_len);
++ if (ret && old_len != new_len)
++ goto out;
++ ret = addr;
+ if (!(flags & MREMAP_FIXED) || (new_addr == addr))
+ goto out;
+ }