diff options
Diffstat (limited to 'Kernel/Net/NetworkingManagement.cpp')
-rw-r--r-- | Kernel/Net/NetworkingManagement.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Kernel/Net/NetworkingManagement.cpp b/Kernel/Net/NetworkingManagement.cpp index 87ce7c2bb8..1c91b0dac0 100644 --- a/Kernel/Net/NetworkingManagement.cpp +++ b/Kernel/Net/NetworkingManagement.cpp @@ -78,10 +78,9 @@ ErrorOr<NonnullOwnPtr<KString>> NetworkingManagement::generate_interface_name_fr { VERIFY(device_identifier.class_code().value() == 0x2); // Note: This stands for e - "Ethernet", p - "Port" as for PCI bus, "s" for slot as for PCI slot - auto name = String::formatted("ep{}s{}", device_identifier.address().bus(), device_identifier.address().device()); - VERIFY(!NetworkingManagement::the().lookup_by_name(name)); - // TODO: We need some way to to format data into a `KString`. - return KString::try_create(name.view()); + auto name = TRY(KString::formatted("ep{}s{}", device_identifier.address().bus(), device_identifier.address().device())); + VERIFY(!NetworkingManagement::the().lookup_by_name(name->view())); + return name; } UNMAP_AFTER_INIT RefPtr<NetworkAdapter> NetworkingManagement::determine_network_device(PCI::DeviceIdentifier const& device_identifier) const |