1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +00:00

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
parent a0f404551e
commit e729c3ae36

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;
}