diff options
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -143,7 +143,11 @@ int __vm_enough_memory(long pages, int cap_sys_admin) | |||
143 | leave 3% of the size of this process for other processes */ | 143 | leave 3% of the size of this process for other processes */ |
144 | allowed -= current->mm->total_vm / 32; | 144 | allowed -= current->mm->total_vm / 32; |
145 | 145 | ||
146 | if (atomic_read(&vm_committed_space) < allowed) | 146 | /* |
147 | * cast `allowed' as a signed long because vm_committed_space | ||
148 | * sometimes has a negative value | ||
149 | */ | ||
150 | if (atomic_read(&vm_committed_space) < (long)allowed) | ||
147 | return 0; | 151 | return 0; |
148 | 152 | ||
149 | vm_unacct_memory(pages); | 153 | vm_unacct_memory(pages); |