aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2023-10-18 13:43:02 +0000
committerMark Johnston <markj@FreeBSD.org>2023-10-25 16:53:08 +0000
commita2c17b534d37467d51c865a0830d9186b1aa8a98 (patch)
tree62945466935a01c895f66fdacf498be4330003df
parent87dbb943df73022dd98487c123aeb125da11c4af (diff)
downloadsrc-a2c17b534d37467d51c865a0830d9186b1aa8a98.tar.gz
src-a2c17b534d37467d51c865a0830d9186b1aa8a98.zip
linuxkpi: Fix an assertion in linux_free_kmem()
In the LinuxKPI, PAGE_MASK is the logical negation of FreeBSD's PAGE_MASK, so the original assertion was simply incorrect. Approved by: re (gjb) Reported by: trasz Tested by: trasz Fixes: 6223d0b67af9 ("linuxkpi: Handle direct-mapped addresses in linux_free_kmem()") (cherry picked from commit f88bd1174aab1aff7fea7241ab6e103e769d2d7a) (cherry picked from commit 501e1152d2a047f8ff8fba6e6efbd2d5e9872738)
-rw-r--r--sys/compat/linuxkpi/common/src/linux_page.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c
index 21e338acb089..ead2f24cf5df 100644
--- a/sys/compat/linuxkpi/common/src/linux_page.c
+++ b/sys/compat/linuxkpi/common/src/linux_page.c
@@ -193,7 +193,7 @@ linux_alloc_kmem(gfp_t flags, unsigned int order)
void
linux_free_kmem(vm_offset_t addr, unsigned int order)
{
- KASSERT((addr & PAGE_MASK) == 0,
+ KASSERT((addr & ~PAGE_MASK) == 0,
("%s: addr %p is not page aligned", __func__, (void *)addr));
if (addr >= VM_MIN_KERNEL_ADDRESS && addr < VM_MAX_KERNEL_ADDRESS) {