Skip to content

Commit

Permalink
Kernel/Memory: Remove needless VERIFY in /dev/mem mmap validation method
Browse files Browse the repository at this point in the history
As it was pointed by Idan Horowitz, the rest of the method doesn't
assume we have any reserved ranges to allow mmap(2) to work on them, so
the VERIFY is not needed at all.
  • Loading branch information
supercomputer7 authored and IdanHo committed Jan 7, 2022
1 parent 10ec98d commit 3e066d3
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion Kernel/Memory/MemoryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ UNMAP_AFTER_INIT void MemoryManager::register_reserved_ranges()

bool MemoryManager::is_allowed_to_mmap_to_userspace(PhysicalAddress start_address, VirtualRange const& range) const
{
VERIFY(!m_reserved_memory_ranges.is_empty());
// Note: Guard against overflow in case someone tries to mmap on the edge of
// the RAM
if (start_address.offset_addition_would_overflow(range.size()))
Expand Down

0 comments on commit 3e066d3

Please sign in to comment.