diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-01-13 18:20:22 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-13 22:40:25 +0100 |
commit | fb3e46e930aaf03fa1caec0cdf18ba48b12e1b0e (patch) | |
tree | 5bb7c83a09bedcdb2d5431837bcedb61799d7de8 /Kernel/Devices/MemoryDevice.cpp | |
parent | e2e5d4da164aad9b4a77ce5f2c7bfad3dafb9a86 (diff) | |
download | serenity-fb3e46e930aaf03fa1caec0cdf18ba48b12e1b0e.zip |
Kernel: Make map_typed() & map_typed_writable() fallible using ErrorOr
This mostly just moved the problem, as a lot of the callers are not
capable of propagating the errors themselves, but it's a step in the
right direction.
Diffstat (limited to 'Kernel/Devices/MemoryDevice.cpp')
-rw-r--r-- | Kernel/Devices/MemoryDevice.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Devices/MemoryDevice.cpp b/Kernel/Devices/MemoryDevice.cpp index 30367eed6a..6396f07b5d 100644 --- a/Kernel/Devices/MemoryDevice.cpp +++ b/Kernel/Devices/MemoryDevice.cpp @@ -38,7 +38,7 @@ ErrorOr<size_t> MemoryDevice::read(OpenFileDescription&, u64 offset, UserOrKerne dbgln("MemoryDevice: Trying to read physical memory at {} for range of {} bytes failed due to violation of access", PhysicalAddress(offset), length); return EINVAL; } - auto mapping = Memory::map_typed<u8>(PhysicalAddress(offset), length); + auto mapping = TRY(Memory::map_typed<u8>(PhysicalAddress(offset), length)); auto bytes = ReadonlyBytes { mapping.ptr(), length }; TRY(buffer.write(bytes)); |