summaryrefslogtreecommitdiff
path: root/Kernel/Bus/VirtIO
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-01-20 21:10:46 +0200
committerAndreas Kling <kling@serenityos.org>2022-01-21 16:27:21 +0100
commitd65347d39dd89013a0c46d8206c77e65d6dceda1 (patch)
tree01695d1306f8fe444fc558262ae31d4a0e1441d4 /Kernel/Bus/VirtIO
parent9eccd4c56e09fb5b7a08e4288d174f5a27c75695 (diff)
downloadserenity-d65347d39dd89013a0c46d8206c77e65d6dceda1.zip
Kernel: Make Memory::RingBuffer construction fallible
Diffstat (limited to 'Kernel/Bus/VirtIO')
-rw-r--r--Kernel/Bus/VirtIO/Console.cpp4
-rw-r--r--Kernel/Bus/VirtIO/ConsolePort.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Bus/VirtIO/Console.cpp b/Kernel/Bus/VirtIO/Console.cpp
index de4f2779bc..b46475286e 100644
--- a/Kernel/Bus/VirtIO/Console.cpp
+++ b/Kernel/Bus/VirtIO/Console.cpp
@@ -123,8 +123,8 @@ void Console::handle_queue_update(u16 queue_index)
void Console::setup_multiport()
{
- m_control_receive_buffer = make<Memory::RingBuffer>("VirtIOConsole control receive queue"sv, CONTROL_BUFFER_SIZE);
- m_control_transmit_buffer = make<Memory::RingBuffer>("VirtIOConsole control transmit queue"sv, CONTROL_BUFFER_SIZE);
+ m_control_receive_buffer = Memory::RingBuffer::try_create("VirtIOConsole control receive queue"sv, CONTROL_BUFFER_SIZE).release_value_but_fixme_should_propagate_errors();
+ m_control_transmit_buffer = Memory::RingBuffer::try_create("VirtIOConsole control transmit queue"sv, CONTROL_BUFFER_SIZE).release_value_but_fixme_should_propagate_errors();
auto& queue = get_queue(CONTROL_RECEIVEQ);
SpinlockLocker queue_lock(queue.lock());
diff --git a/Kernel/Bus/VirtIO/ConsolePort.cpp b/Kernel/Bus/VirtIO/ConsolePort.cpp
index 78149e2380..8545aac8ae 100644
--- a/Kernel/Bus/VirtIO/ConsolePort.cpp
+++ b/Kernel/Bus/VirtIO/ConsolePort.cpp
@@ -17,8 +17,8 @@ ConsolePort::ConsolePort(unsigned port, VirtIO::Console& console)
, m_console(console)
, m_port(port)
{
- m_receive_buffer = make<Memory::RingBuffer>("VirtIO::ConsolePort Receive"sv, RINGBUFFER_SIZE);
- m_transmit_buffer = make<Memory::RingBuffer>("VirtIO::ConsolePort Transmit"sv, RINGBUFFER_SIZE);
+ m_receive_buffer = Memory::RingBuffer::try_create("VirtIO::ConsolePort Receive"sv, RINGBUFFER_SIZE).release_value_but_fixme_should_propagate_errors();
+ m_transmit_buffer = Memory::RingBuffer::try_create("VirtIO::ConsolePort Transmit"sv, RINGBUFFER_SIZE).release_value_but_fixme_should_propagate_errors();
m_receive_queue = m_port == 0 ? 0 : m_port * 2 + 2;
m_transmit_queue = m_port == 0 ? 1 : m_port * 2 + 3;
}