diff --git a/mm/mm_gran/mm_pgalloc.c b/mm/mm_gran/mm_pgalloc.c index 69e52d03d3..b0a939b109 100644 --- a/mm/mm_gran/mm_pgalloc.c +++ b/mm/mm_gran/mm_pgalloc.c @@ -122,7 +122,7 @@ static GRAN_HANDLE g_pgalloc; void mm_pginitialize(FAR void *heap_start, size_t heap_size) { g_pgalloc = gran_initialize(heap_start, heap_size, MM_PGSHIFT, MM_PGSHIFT); - DEBUGASSERT(pg_alloc != NULL); + DEBUGASSERT(g_pgalloc != NULL); } /**************************************************************************** @@ -169,7 +169,7 @@ void mm_pgreserve(uintptr_t start, size_t size) uintptr_t mm_pgalloc(unsigned int npages) { - return (uintptr_t)gran_alloc(g_pgalloc, (size_t)1 << MM_PGSHIFT); + return (uintptr_t)gran_alloc(g_pgalloc, (size_t)npages << MM_PGSHIFT); } /****************************************************************************