Don't allocate memory for 0-page-sized requests

Previously the allocator would return all availble memory for a
request of 0 pages. This is rather counter-intuitive and left no
memory for subsequent allocations.
This commit is contained in:
Hannes Weisbach
2017-09-20 10:34:49 +09:00
parent 8813e890c5
commit 0a22320a3c

View File

@ -553,6 +553,9 @@ static void *mckernel_allocate_aligned_pages_node(int npages, int p2align,
#endif
int numa_id;
if(npages <= 0)
return NULL;
/* Not yet initialized or idle process */
if (!cpu_local_var_initialized ||
!cpu_local_var(current) ||