X86PagingStructuresPAE: Zero fPageDirPointerTable in constructor
... and use it as a guard in the destructor. Fixes crash when running out of memory and Init() is not called.
This commit is contained in:
parent
7d09a8dc67
commit
9a85313bc6
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
|
|
||||||
X86PagingStructuresPAE::X86PagingStructuresPAE()
|
X86PagingStructuresPAE::X86PagingStructuresPAE()
|
||||||
|
:
|
||||||
|
fPageDirPointerTable(NULL)
|
||||||
{
|
{
|
||||||
memset(fVirtualPageDirs, 0, sizeof(fVirtualPageDirs));
|
memset(fVirtualPageDirs, 0, sizeof(fVirtualPageDirs));
|
||||||
}
|
}
|
||||||
@ -32,8 +34,10 @@ X86PagingStructuresPAE::~X86PagingStructuresPAE()
|
|||||||
// There's one contiguous allocation for 0 and 1.
|
// There's one contiguous allocation for 0 and 1.
|
||||||
|
|
||||||
// free the PDPT page
|
// free the PDPT page
|
||||||
X86PagingMethodPAE::Method()->Free32BitPage(fPageDirPointerTable,
|
if (fPageDirPointerTable != NULL) {
|
||||||
pgdir_phys, fPageDirPointerTableHandle);
|
X86PagingMethodPAE::Method()->Free32BitPage(fPageDirPointerTable,
|
||||||
|
pgdir_phys, fPageDirPointerTableHandle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user