diff --git a/Kernel/Devices/FullDevice.cpp b/Kernel/Devices/FullDevice.cpp index fec5cc50c9c..852a4fa50e0 100644 --- a/Kernel/Devices/FullDevice.cpp +++ b/Kernel/Devices/FullDevice.cpp @@ -15,7 +15,7 @@ namespace Kernel { UNMAP_AFTER_INIT NonnullRefPtr FullDevice::must_create() { - return adopt_ref_if_nonnull(new FullDevice).release_nonnull(); + return adopt_ref(*new FullDevice); } UNMAP_AFTER_INIT FullDevice::FullDevice() @@ -45,5 +45,4 @@ KResultOr FullDevice::write(FileDescription&, u64, const UserOrKernelBuf return 0; return ENOSPC; } - } diff --git a/Kernel/Devices/MemoryDevice.cpp b/Kernel/Devices/MemoryDevice.cpp index 4a7ee97e56b..6955a6dc346 100644 --- a/Kernel/Devices/MemoryDevice.cpp +++ b/Kernel/Devices/MemoryDevice.cpp @@ -17,7 +17,7 @@ namespace Kernel { UNMAP_AFTER_INIT NonnullRefPtr MemoryDevice::must_create() { - return adopt_ref_if_nonnull(new MemoryDevice).release_nonnull(); + return adopt_ref(*new MemoryDevice); } UNMAP_AFTER_INIT MemoryDevice::MemoryDevice() diff --git a/Kernel/Devices/RandomDevice.cpp b/Kernel/Devices/RandomDevice.cpp index 302ab4a00b0..538e91ac378 100644 --- a/Kernel/Devices/RandomDevice.cpp +++ b/Kernel/Devices/RandomDevice.cpp @@ -13,7 +13,7 @@ namespace Kernel { UNMAP_AFTER_INIT NonnullRefPtr RandomDevice::must_create() { - return adopt_ref_if_nonnull(new RandomDevice).release_nonnull(); + return adopt_ref(*new RandomDevice); } UNMAP_AFTER_INIT RandomDevice::RandomDevice() diff --git a/Kernel/Devices/ZeroDevice.cpp b/Kernel/Devices/ZeroDevice.cpp index 37324d2376c..e2c7908a4f0 100644 --- a/Kernel/Devices/ZeroDevice.cpp +++ b/Kernel/Devices/ZeroDevice.cpp @@ -14,7 +14,7 @@ namespace Kernel { UNMAP_AFTER_INIT NonnullRefPtr ZeroDevice::must_create() { - return adopt_ref_if_nonnull(new ZeroDevice).release_nonnull(); + return adopt_ref(*new ZeroDevice); } UNMAP_AFTER_INIT ZeroDevice::ZeroDevice()