1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 10:14:58 +00:00

Kernel: Handle OOM from DoubleBuffer creation in FIFO creation

This commit is contained in:
Brian Gianforcaro 2021-08-01 02:30:52 -07:00 committed by Andreas Kling
parent 15cd5d324c
commit 8d3b819daf
4 changed files with 25 additions and 16 deletions

View file

@ -185,8 +185,11 @@ NonnullRefPtr<FIFO> Inode::fifo()
VERIFY(metadata().is_fifo());
// FIXME: Release m_fifo when it is closed by all readers and writers
if (!m_fifo)
m_fifo = FIFO::create(metadata().uid);
if (!m_fifo) {
m_fifo = FIFO::try_create(metadata().uid);
// FIXME: We need to be able to observe OOM here.
VERIFY(!m_fifo.is_null());
}
VERIFY(m_fifo);
return *m_fifo;