Fix overallocation

git-svn-id: svn://coreboot.org/openbios/openbios-devel@146 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2007-05-17 19:07:21 +00:00
parent 788d096f65
commit c5beeefb90

View File

@@ -194,7 +194,7 @@ map_io(unsigned pa, int size)
unsigned int mva;
off = pa & (PAGE_SIZE - 1);
npages = (off + size + (PAGE_SIZE - 1)) / PAGE_SIZE;
npages = (off + (size - 1) + (PAGE_SIZE - 1)) / PAGE_SIZE;
pa &= ~(PAGE_SIZE - 1);
va = mem_alloc(&cio, npages * PAGE_SIZE, PAGE_SIZE);