summaryrefslogtreecommitdiff
path: root/Kernel/Net/NE2000NetworkAdapter.cpp
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2021-06-20 10:21:16 +0200
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-06-24 17:35:49 +0430
commitf820917a765d1ac74af5f66567becb955996b0d8 (patch)
tree98dc6d46387daef9ecedd815bd822753a2f8813a /Kernel/Net/NE2000NetworkAdapter.cpp
parent00915e89482994a07321fe0788e12cdab0b761fe (diff)
downloadserenity-f820917a765d1ac74af5f66567becb955996b0d8.zip
Everywhere: Use nothrow new with `adopt_{ref,own}_if_nonnull`
This commit converts naked `new`s to `AK::try_make` and `AK::try_create` wherever possible. If the called constructor is private, this can not be done, so we instead now use the standard-defined and compiler-agnostic `new (nothrow)`.
Diffstat (limited to 'Kernel/Net/NE2000NetworkAdapter.cpp')
-rw-r--r--Kernel/Net/NE2000NetworkAdapter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Net/NE2000NetworkAdapter.cpp b/Kernel/Net/NE2000NetworkAdapter.cpp
index 438d40867d..7695a3a88c 100644
--- a/Kernel/Net/NE2000NetworkAdapter.cpp
+++ b/Kernel/Net/NE2000NetworkAdapter.cpp
@@ -157,7 +157,7 @@ UNMAP_AFTER_INIT RefPtr<NE2000NetworkAdapter> NE2000NetworkAdapter::try_to_initi
if (!ne2k_ids.span().contains_slow(id))
return {};
u8 irq = PCI::get_interrupt_line(address);
- return adopt_ref_if_nonnull(new NE2000NetworkAdapter(address, irq));
+ return adopt_ref_if_nonnull(new (nothrow) NE2000NetworkAdapter(address, irq));
}
UNMAP_AFTER_INIT NE2000NetworkAdapter::NE2000NetworkAdapter(PCI::Address address, u8 irq)