Skip to content
Snippets Groups Projects
Commit 089a49d8 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

Correct size comparison (pages vs. sections)

parent 5849298b
No related branches found
No related tags found
No related merge requests found
......@@ -173,10 +173,13 @@ static int up_addrenv_create_region(FAR uintptr_t **list,
/* Verify that we are configured with enough virtual address space to
* support this memory region.
*
* npages pages correspondes to (npages << MM_PGSHIFT) bytes
* listlen sections corresponds to (listlen << 20) bytes
*/
npages = MM_NPAGES(regionsize);
if (npages > listlen)
if (npages > (listlen << (20 - MM_PGSHIFT)))
{
bdbg("ERROR: npages=%u listlen=%u\n", npages, listlen);
return -E2BIG;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment