diff options
author | Liav A <liavalb@gmail.com> | 2022-02-04 22:11:50 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-14 22:39:09 +0100 |
commit | 428d4ae337fa1fa78a0cba80debe8ab1cae34761 (patch) | |
tree | 13ce5fae8388148d7b612f90a8cdf343e021fa06 /Kernel/Storage/StorageManagement.cpp | |
parent | 3fb289e27d3e0ca171438f178ea6750e25ce6f32 (diff) | |
download | serenity-428d4ae337fa1fa78a0cba80debe8ab1cae34761.zip |
Kernel/PCI: Break early of controller iteration over devices in OOM case
This is mainly useful when adding an HostController but due to OOM
condition, we abort temporary Vector insertion of a DeviceIdentifier
and then exit the iteration loop to report back the error if occured.
Diffstat (limited to 'Kernel/Storage/StorageManagement.cpp')
-rw-r--r-- | Kernel/Storage/StorageManagement.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/Storage/StorageManagement.cpp b/Kernel/Storage/StorageManagement.cpp index 3ca934d018..f737140fa5 100644 --- a/Kernel/Storage/StorageManagement.cpp +++ b/Kernel/Storage/StorageManagement.cpp @@ -5,6 +5,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include <AK/IterationDecision.h> #include <AK/Singleton.h> #include <AK/StringView.h> #include <AK/UUID.h> @@ -53,7 +54,7 @@ UNMAP_AFTER_INIT void StorageManagement::enumerate_pci_controllers(bool force_pi using SubclassID = PCI::MassStorage::SubclassID; if (!kernel_command_line().disable_physical_storage()) { - MUST(PCI::enumerate([&](PCI::DeviceIdentifier const& device_identifier) { + MUST(PCI::enumerate([&](PCI::DeviceIdentifier const& device_identifier) -> void { if (device_identifier.class_code().value() != to_underlying(PCI::ClassID::MassStorage)) { return; } |