Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245320
b: refs/heads/master
c: 9c1e8a9
h: refs/heads/master
v: v3
  • Loading branch information
Ralf Baechle committed May 19, 2011
1 parent c1a7306 commit f4d4aa6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e650ce0f083ff9354a10ad66e6bf8c193e8a2755
refs/heads/master: 9c1e8a9138ff92a4ff816ea8a1884ad2461a993a
17 changes: 5 additions & 12 deletions trunk/arch/mips/kernel/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,13 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
{
struct vm_area_struct * vmm;
int do_color_align;
unsigned long task_size;

#ifdef CONFIG_32BIT
task_size = TASK_SIZE;
#else /* Must be CONFIG_64BIT*/
task_size = test_thread_flag(TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE;
#endif

if (len > task_size)
if (len > TASK_SIZE)
return -ENOMEM;

if (flags & MAP_FIXED) {
/* Even MAP_FIXED mappings must reside within task_size. */
if (task_size - len < addr)
/* Even MAP_FIXED mappings must reside within TASK_SIZE. */
if (TASK_SIZE - len < addr)
return -EINVAL;

/*
Expand All @@ -114,7 +107,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
else
addr = PAGE_ALIGN(addr);
vmm = find_vma(current->mm, addr);
if (task_size - len >= addr &&
if (TASK_SIZE - len >= addr &&
(!vmm || addr + len <= vmm->vm_start))
return addr;
}
Expand All @@ -126,7 +119,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,

for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) {
/* At this point: (!vmm || addr < vmm->vm_end). */
if (task_size - len < addr)
if (TASK_SIZE - len < addr)
return -ENOMEM;
if (!vmm || addr + len <= vmm->vm_start)
return addr;
Expand Down

0 comments on commit f4d4aa6

Please sign in to comment.