diff options
-rw-r--r-- | sys/compat/x86bios/x86bios.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/compat/x86bios/x86bios.c b/sys/compat/x86bios/x86bios.c index 14f714e..50383c9 100644 --- a/sys/compat/x86bios/x86bios.c +++ b/sys/compat/x86bios/x86bios.c @@ -142,7 +142,6 @@ x86bios_free(void *addr, size_t size) paddr = vtophys(addr); if (paddr >= X86BIOS_MEM_SIZE || (paddr & PAGE_MASK) != 0) return; - nfree = atop(round_page(size)); mtx_lock(&x86bios_lock); for (i = 0; i < x86bios_vmc.npages; i++) if (x86bios_vmc.pmap[i].kva == (vm_offset_t)addr) @@ -151,6 +150,7 @@ x86bios_free(void *addr, size_t size) mtx_unlock(&x86bios_lock); return; } + nfree = atop(round_page(size)); bzero(x86bios_vmc.pmap + i, sizeof(*x86bios_vmc.pmap) * nfree); if (i + nfree == x86bios_vmc.npages) { x86bios_vmc.npages -= nfree; |