diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-05 16:05:29 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-05 16:25:40 +0200 |
commit | c9a20bcd87f3a9c1b8ea8da61efb972586d2c28f (patch) | |
tree | f2795933281e05e6efd143bf4ef3fb94964eb83b /Kernel | |
parent | 4a2b0f6beceaf831df00932d4a999b43d5008d8c (diff) | |
download | serenity-c9a20bcd87f3a9c1b8ea8da61efb972586d2c28f.zip |
Kernel: Use TRY() in the SoundBlaster16 driver
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Devices/SB16.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Kernel/Devices/SB16.cpp b/Kernel/Devices/SB16.cpp index bebc4bd3d7..6090936a1f 100644 --- a/Kernel/Devices/SB16.cpp +++ b/Kernel/Devices/SB16.cpp @@ -264,11 +264,8 @@ KResultOr<size_t> SB16::write(FileDescription&, u64, UserOrKernelBuffer const& d if (!page) return ENOMEM; auto nonnull_page = page.release_nonnull(); - auto maybe_vmobject = Memory::AnonymousVMObject::try_create_with_physical_pages({ &nonnull_page, 1 }); - if (maybe_vmobject.is_error()) - return maybe_vmobject.error(); - - m_dma_region = MM.allocate_kernel_region_with_vmobject(maybe_vmobject.release_value(), PAGE_SIZE, "SB16 DMA buffer", Memory::Region::Access::Write); + auto vmobject = TRY(Memory::AnonymousVMObject::try_create_with_physical_pages({ &nonnull_page, 1 })); + m_dma_region = MM.allocate_kernel_region_with_vmobject(move(vmobject), PAGE_SIZE, "SB16 DMA buffer", Memory::Region::Access::Write); if (!m_dma_region) return ENOMEM; } |