Correct size comparison (pages vs. sections)
This commit is contained in:
parent
5849298be8
commit
089a49d869
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user