summaryrefslogtreecommitdiff
path: root/Kernel/Storage/RamdiskDevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Storage/RamdiskDevice.cpp')
-rw-r--r--Kernel/Storage/RamdiskDevice.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Storage/RamdiskDevice.cpp b/Kernel/Storage/RamdiskDevice.cpp
index 9a6c510382..6d5a6ebd4f 100644
--- a/Kernel/Storage/RamdiskDevice.cpp
+++ b/Kernel/Storage/RamdiskDevice.cpp
@@ -55,13 +55,13 @@ void RamdiskDevice::start_request(AsyncBlockDeviceRequest& request)
if ((offset + length > base + size) || (offset + length < base)) {
request.complete(AsyncDeviceRequest::Failure);
} else {
- auto result = KResult(KSuccess);
+ ErrorOr<void> result;
if (request.request_type() == AsyncBlockDeviceRequest::Read) {
result = request.buffer().write(offset, length);
} else {
result = request.buffer().read(offset, length);
}
- request.complete(result.is_success() ? AsyncDeviceRequest::Success : AsyncDeviceRequest::MemoryFault);
+ request.complete(!result.is_error() ? AsyncDeviceRequest::Success : AsyncDeviceRequest::MemoryFault);
}
}