mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 04:41:56 +00:00
Kernel: Handle OOM from DoubleBuffer creation in FIFO creation
This commit is contained in:
parent
15cd5d324c
commit
8d3b819daf
Notes:
sideshowbarker
2024-07-18 07:31:59 +09:00
Author: https://github.com/bgianfo
Commit: 8d3b819daf
Pull-request: https://github.com/SerenityOS/serenity/pull/9154
Reviewed-by: https://github.com/alimpfard ✅
4 changed files with 25 additions and 16 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue