make allocate_pages in kernel/mem.c propagate error from aal_pagealloc_alloc (physical address of zero) to callee

This commit is contained in:
Masamichi Takagi m-takagi@ab.jp.nec.com
2012-10-30 14:12:35 +09:00
parent 9fe8d548fb
commit 3ff50170b6

View File

@ -34,7 +34,10 @@ static void reserve_pages(unsigned long start, unsigned long end, int type)
void *allocate_pages(int npages, enum aal_mc_ap_flag flag)
{
return phys_to_virt(aal_pagealloc_alloc(pa_allocator, npages));
unsigned long pa = aal_pagealloc_alloc(pa_allocator, npages);
/* all_pagealloc_alloc returns zero when error occured,
and callee (in mcos/kernel/process.c) so propagate it */
return pa ? phys_to_virt(pa) : 0;
}
void free_pages(void *va, int npages)