Kernel: Add missing nothrow tag to DeviceManagement::try_create_device

Without this tag this method was essentially a must_create.
This commit is contained in:
Idan Horowitz 2022-01-26 21:59:13 +02:00 committed by Linus Groh
commit e729c3ae36
Notes: sideshowbarker 2024-07-17 20:10:22 +09:00

View file

@ -59,7 +59,7 @@ public:
template<typename DeviceType, typename... Args>
static inline ErrorOr<NonnullRefPtr<DeviceType>> try_create_device(Args&&... args)
{
auto device = TRY(adopt_nonnull_ref_or_enomem(new DeviceType(forward<Args>(args)...)));
auto device = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) DeviceType(forward<Args>(args)...)));
device->after_inserting();
return device;
}