projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
usb: dwc_otg hcd driver: fix a race condition
[firefly-linux-kernel-4.4.55.git]
/
mm
/
mmap.c
diff --git
a/mm/mmap.c
b/mm/mmap.c
index e90411b9ebe58342d2c7e50ca08473a6b7f6ed6e..9aa554b7e620e1c0596a45035fbf0ebc3372dd0e 100644
(file)
--- a/
mm/mmap.c
+++ b/
mm/mmap.c
@@
-1860,7
+1860,7
@@
arch_get_unmapped_area(struct file *filp, unsigned long addr,
struct vm_area_struct *vma;
struct vm_unmapped_area_info info;
struct vm_area_struct *vma;
struct vm_unmapped_area_info info;
- if (len > TASK_SIZE)
+ if (len > TASK_SIZE
- mmap_min_addr
)
return -ENOMEM;
if (flags & MAP_FIXED)
return -ENOMEM;
if (flags & MAP_FIXED)
@@
-1869,7
+1869,7
@@
arch_get_unmapped_area(struct file *filp, unsigned long addr,
if (addr) {
addr = PAGE_ALIGN(addr);
vma = find_vma(mm, addr);
if (addr) {
addr = PAGE_ALIGN(addr);
vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
+ if (TASK_SIZE - len >= addr &&
addr >= mmap_min_addr &&
(!vma || addr + len <= vma->vm_start))
return addr;
}
(!vma || addr + len <= vma->vm_start))
return addr;
}
@@
-1908,7
+1908,7
@@
arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
struct vm_unmapped_area_info info;
/* requested length too big for entire address space */
struct vm_unmapped_area_info info;
/* requested length too big for entire address space */
- if (len > TASK_SIZE)
+ if (len > TASK_SIZE
- mmap_min_addr
)
return -ENOMEM;
if (flags & MAP_FIXED)
return -ENOMEM;
if (flags & MAP_FIXED)
@@
-1918,14
+1918,14
@@
arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
if (addr) {
addr = PAGE_ALIGN(addr);
vma = find_vma(mm, addr);
if (addr) {
addr = PAGE_ALIGN(addr);
vma = find_vma(mm, addr);
- if (TASK_SIZE - len >= addr &&
+ if (TASK_SIZE - len >= addr &&
addr >= mmap_min_addr &&
(!vma || addr + len <= vma->vm_start))
return addr;
}
info.flags = VM_UNMAPPED_AREA_TOPDOWN;
info.length = len;
(!vma || addr + len <= vma->vm_start))
return addr;
}
info.flags = VM_UNMAPPED_AREA_TOPDOWN;
info.length = len;
- info.low_limit =
PAGE_SIZE
;
+ info.low_limit =
max(PAGE_SIZE, mmap_min_addr)
;
info.high_limit = mm->mmap_base;
info.align_mask = 0;
addr = vm_unmapped_area(&info);
info.high_limit = mm->mmap_base;
info.align_mask = 0;
addr = vm_unmapped_area(&info);