mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Fix overallocation
git-svn-id: svn://coreboot.org/openbios/openbios-devel@146 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user