diff options
Diffstat (limited to 'Kernel/Storage/PATADiskDevice.cpp')
-rw-r--r-- | Kernel/Storage/PATADiskDevice.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Kernel/Storage/PATADiskDevice.cpp b/Kernel/Storage/PATADiskDevice.cpp index 015ff71d9c..d4aab035b0 100644 --- a/Kernel/Storage/PATADiskDevice.cpp +++ b/Kernel/Storage/PATADiskDevice.cpp @@ -15,7 +15,10 @@ namespace Kernel { UNMAP_AFTER_INIT NonnullRefPtr<PATADiskDevice> PATADiskDevice::create(const IDEController& controller, IDEChannel& channel, DriveType type, InterfaceType interface_type, u16 capabilities, u64 max_addressable_block) { - return adopt_ref(*new PATADiskDevice(controller, channel, type, interface_type, capabilities, max_addressable_block)); + auto device_or_error = try_create_device<PATADiskDevice>(controller, channel, type, interface_type, capabilities, max_addressable_block); + // FIXME: Find a way to propagate errors + VERIFY(!device_or_error.is_error()); + return device_or_error.release_value(); } UNMAP_AFTER_INIT PATADiskDevice::PATADiskDevice(const IDEController& controller, IDEChannel& channel, DriveType type, InterfaceType interface_type, u16 capabilities, u64 max_addressable_block) |