This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / mips / kernel / sysirix.c
index 494d187..3e0cf6e 100644 (file)
@@ -577,7 +577,8 @@ asmlinkage int irix_brk(unsigned long brk)
        /*
         * Check if we have enough memory..
         */
-       if (security_vm_enough_memory((newbrk-oldbrk) >> PAGE_SHIFT)) {
+       if (security_vm_enough_memory((newbrk-oldbrk) >> PAGE_SHIFT) ||
+               !vx_vmpages_avail(mm, (newbrk-oldbrk) >> PAGE_SHIFT)) {
                ret = -ENOMEM;
                goto out;
        }
@@ -1639,7 +1640,7 @@ asmlinkage int irix_statvfs64(char *fname, struct irix_statvfs64 *buf)
 
        printk("[%s:%d] Wheee.. irix_statvfs(%s,%p)\n",
               current->comm, current->pid, fname, buf);
-       error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs64));
+       error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs));
        if(error)
                goto out;
        error = user_path_walk(fname, &nd);