mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
Kernel: Handle OOM from KBuffer usage in Ext2FS::get_bitmap_block()
Fixes up error handling on an OOM-able path, and removes one more usage of KBuffer::create_with_size.
This commit is contained in:
committed by
Andreas Kling
parent
43f930d3aa
commit
15cd5d324c
@@ -168,15 +168,15 @@ private:
|
||||
bool m_block_group_descriptors_dirty { false };
|
||||
|
||||
struct CachedBitmap {
|
||||
CachedBitmap(BlockIndex bi, KBuffer&& buf)
|
||||
CachedBitmap(BlockIndex bi, NonnullOwnPtr<KBuffer> buf)
|
||||
: bitmap_block_index(bi)
|
||||
, buffer(move(buf))
|
||||
{
|
||||
}
|
||||
BlockIndex bitmap_block_index { 0 };
|
||||
bool dirty { false };
|
||||
KBuffer buffer;
|
||||
BitmapView bitmap(u32 blocks_per_group) { return BitmapView { buffer.data(), blocks_per_group }; }
|
||||
NonnullOwnPtr<KBuffer> buffer;
|
||||
BitmapView bitmap(u32 blocks_per_group) { return BitmapView { buffer->data(), blocks_per_group }; }
|
||||
};
|
||||
|
||||
KResultOr<CachedBitmap*> get_bitmap_block(BlockIndex);
|
||||
|
||||
Reference in New Issue
Block a user