Kernel: Fix allocating VMObject from page array

The VMObject constructor takes the size in bytes.

Fixes #8670
This commit is contained in:
Tom 2021-07-11 21:22:38 -06:00 committed by Gunnar Beutner
parent 84b4b9447d
commit 9318d9f284

View file

@ -117,7 +117,7 @@ AnonymousVMObject::AnonymousVMObject(PhysicalPage& page)
}
AnonymousVMObject::AnonymousVMObject(NonnullRefPtrVector<PhysicalPage> physical_pages)
: VMObject(physical_pages.size())
: VMObject(physical_pages.size() * PAGE_SIZE)
, m_volatile_ranges_cache({ 0, page_count() })
{
for (size_t i = 0; i < physical_pages.size(); ++i) {