powerpc/mm: Switch some TASK_SIZE checks to use mm_context addr_limit
[linux-2.6-block.git] / arch / powerpc / mm / subpage-prot.c
index 94210940112f808311bcf263c968dd800d3cf7c2..a409f78d206bf47936a366ee05540441474e2342 100644 (file)
@@ -197,7 +197,8 @@ long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map)
 
        /* Check parameters */
        if ((addr & ~PAGE_MASK) || (len & ~PAGE_MASK) ||
-           addr >= TASK_SIZE || len >= TASK_SIZE || addr + len > TASK_SIZE)
+           addr >= mm->context.addr_limit || len >= mm->context.addr_limit ||
+           addr + len > mm->context.addr_limit)
                return -EINVAL;
 
        if (is_hugepage_only_range(mm, addr, len))