make allocate_pages in kernel/mem.c propagate error from aal_pagealloc_alloc (physical address of zero) to callee
This commit is contained in:
parent
9fe8d548fb
commit
3ff50170b6
@@ -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)
|
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)
|
void free_pages(void *va, int npages)
|
||||||
|
|||||||
Reference in New Issue
Block a user