mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel/PCI: Verify Access is not initialized before initializing it
There's no valid case where we should try to initialize the Access singleton multiple times, therefore just assert if it ever happens.
This commit is contained in:
parent
78d1093dab
commit
cecfd42916
Notes:
sideshowbarker
2024-07-17 20:31:18 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/cecfd42916d Pull-request: https://github.com/SerenityOS/serenity/pull/12048
1 changed files with 2 additions and 6 deletions
|
@ -88,9 +88,7 @@ UNMAP_AFTER_INIT bool Access::find_and_register_pci_host_bridges_from_acpi_mcfg_
|
|||
|
||||
UNMAP_AFTER_INIT bool Access::initialize_for_multiple_pci_domains(PhysicalAddress mcfg_table)
|
||||
{
|
||||
if (Access::is_initialized())
|
||||
return false;
|
||||
|
||||
VERIFY(!Access::is_initialized());
|
||||
auto* access = new Access();
|
||||
if (!access->find_and_register_pci_host_bridges_from_acpi_mcfg_table(mcfg_table))
|
||||
return false;
|
||||
|
@ -101,9 +99,7 @@ UNMAP_AFTER_INIT bool Access::initialize_for_multiple_pci_domains(PhysicalAddres
|
|||
|
||||
UNMAP_AFTER_INIT bool Access::initialize_for_one_pci_domain()
|
||||
{
|
||||
if (Access::is_initialized()) {
|
||||
return false;
|
||||
}
|
||||
VERIFY(!Access::is_initialized());
|
||||
auto* access = new Access();
|
||||
auto host_bridge = HostBridge::must_create_with_io_access();
|
||||
access->add_host_controller(move(host_bridge));
|
||||
|
|
Loading…
Reference in a new issue