From 5c24d189237bbd5e8ce9fe8236efd50ca10dadb0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 14 Jul 2021 00:13:18 +0200 Subject: [PATCH] Kernel: Fix logic error in PhysicalRegion::contains() This was incorrectly returning true for the address one byte past the end of the region. --- Kernel/VM/PhysicalRegion.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/VM/PhysicalRegion.h b/Kernel/VM/PhysicalRegion.h index 769ca35f305..c6962768c84 100644 --- a/Kernel/VM/PhysicalRegion.h +++ b/Kernel/VM/PhysicalRegion.h @@ -30,7 +30,7 @@ public: PhysicalAddress lower() const { return m_lower; } PhysicalAddress upper() const { return m_upper; } unsigned size() const { return m_pages; } - bool contains(PhysicalAddress paddr) const { return paddr >= m_lower && paddr <= m_upper; } + bool contains(PhysicalAddress paddr) const { return paddr >= m_lower && paddr < m_upper; } OwnPtr try_take_pages_from_beginning(unsigned);