mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 07:41:01 +00:00
Kernel: Don't crash if unable to map ramdisk inside kernel address space
This commit is contained in:
parent
436ca2491d
commit
346e0f4dac
Notes:
sideshowbarker
2024-07-18 20:43:25 +09:00
Author: https://github.com/boricj
Commit: 346e0f4dac
Pull-request: https://github.com/SerenityOS/serenity/pull/6156
3 changed files with 9 additions and 6 deletions
|
@ -70,7 +70,10 @@ RamdiskController::RamdiskController()
|
|||
if (used_memory_range.type == UsedMemoryRangeType::BootModule) {
|
||||
size_t length = page_round_up(used_memory_range.end.get()) - used_memory_range.start.get();
|
||||
auto region = MemoryManager::the().allocate_kernel_region(used_memory_range.start, length, "Ramdisk", Region::Access::Read | Region::Access::Write);
|
||||
m_devices.append(RamdiskDevice::create(*this, move(region), 6, count));
|
||||
if (!region)
|
||||
dmesgln("RamdiskController: Failed to allocate kernel region of size {}", length);
|
||||
else
|
||||
m_devices.append(RamdiskDevice::create(*this, region.release_nonnull(), 6, count));
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue