]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - ipc/shm.c
h63xx: tsc2101 alsa sound support
[linux-2.6-omap-h63xx.git] / ipc / shm.c
index 0b92e874fc068fb1bc34f3e5940cfb45542f29f7..9162123a7b23c348aca8669c56ea56bfbeacadb6 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -27,6 +27,7 @@
 #include <linux/security.h>
 #include <linux/syscalls.h>
 #include <linux/audit.h>
+#include <linux/capability.h>
 #include <linux/ptrace.h>
 #include <linux/seq_file.h>
 
@@ -869,6 +870,7 @@ asmlinkage long sys_shmdt(char __user *shmaddr)
         * could possibly have landed at. Also cast things to loff_t to
         * prevent overflows and make comparisions vs. equal-width types.
         */
+       size = PAGE_ALIGN(size);
        while (vma && (loff_t)(vma->vm_end - addr) <= size) {
                next = vma->vm_next;