Page MenuHomeFreeBSD

D40746.diff
No OneTemporary

D40746.diff

diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c
--- a/sys/kern/subr_pctrie.c
+++ b/sys/kern/subr_pctrie.c
@@ -560,8 +560,9 @@
NULL, PCTRIE_LOCKED);
if (pctrie_isleaf(child)) {
m = pctrie_toval(child);
- if (*m >= index)
- return (m);
+ KASSERT(*m >= index,
+ ("pctrie_lookup_ge: leaf < index"));
+ return (m);
} else if (child != NULL)
goto descend;
} while (slot < (PCTRIE_COUNT - 1));
@@ -677,8 +678,9 @@
NULL, PCTRIE_LOCKED);
if (pctrie_isleaf(child)) {
m = pctrie_toval(child);
- if (*m <= index)
- return (m);
+ KASSERT(*m <= index,
+ ("pctrie_lookup_le: leaf > index"));
+ return (m);
} else if (child != NULL)
goto descend;
} while (slot > 0);
diff --git a/sys/vm/vm_radix.c b/sys/vm/vm_radix.c
--- a/sys/vm/vm_radix.c
+++ b/sys/vm/vm_radix.c
@@ -595,8 +595,9 @@
LOCKED);
if (vm_radix_isleaf(child)) {
m = vm_radix_topage(child);
- if (m->pindex >= index)
- return (m);
+ KASSERT(m->pindex >= index,
+ ("vm_radix_lookup_ge: leaf<index"));
+ return (m);
} else if (child != NULL)
goto descend;
} while (slot < (VM_RADIX_COUNT - 1));
@@ -709,8 +710,9 @@
LOCKED);
if (vm_radix_isleaf(child)) {
m = vm_radix_topage(child);
- if (m->pindex <= index)
- return (m);
+ KASSERT(m->pindex <= index,
+ ("vm_radix_lookup_le: leaf>index"));
+ return (m);
} else if (child != NULL)
goto descend;
} while (slot > 0);

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 16, 12:23 PM (21 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14658657
Default Alt Text
D40746.diff (1 KB)

Event Timeline