X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=mm%2Fnommu.c;h=fd4e8df0f02df979bb2a2de5a891e35f82754a7d;hb=52b7efdbe5f5696fc80338560a3fc51e0b0a993c;hp=ce74452c02d945e40e6cdb503499609f24e1cd64;hpb=7ca6448dbfb398bba36eda3c01bc14b86c3675be;p=linux-2.6-omap-h63xx.git diff --git a/mm/nommu.c b/mm/nommu.c index ce74452c02d..fd4e8df0f02 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -1167,7 +1167,11 @@ int __vm_enough_memory(long pages, int cap_sys_admin) leave 3% of the size of this process for other processes */ allowed -= current->mm->total_vm / 32; - if (atomic_read(&vm_committed_space) < allowed) + /* + * cast `allowed' as a signed long because vm_committed_space + * sometimes has a negative value + */ + if (atomic_read(&vm_committed_space) < (long)allowed) return 0; vm_unacct_memory(pages);