Kernel/Net: Don't try to enumerate PCI adapters if PCI is disabled

This commit is contained in:
Liav A 2022-01-21 16:09:47 +02:00 committed by Andreas Kling
parent b849e4f907
commit 71de4f7114
Notes: sideshowbarker 2024-07-17 18:02:20 +09:00

View file

@ -111,7 +111,7 @@ UNMAP_AFTER_INIT RefPtr<NetworkAdapter> NetworkingManagement::determine_network_
bool NetworkingManagement::initialize()
{
if (!kernel_command_line().is_physical_networking_disabled()) {
if (!kernel_command_line().is_physical_networking_disabled() && !PCI::Access::is_disabled()) {
PCI::enumerate([&](PCI::DeviceIdentifier const& device_identifier) {
// Note: PCI class 2 is the class of Network devices
if (device_identifier.class_code().value() != 0x02)