summaryrefslogtreecommitdiffstats
path: root/kernel/lib/assoc_array.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/lib/assoc_array.c')
-rw-r--r--kernel/lib/assoc_array.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/lib/assoc_array.c b/kernel/lib/assoc_array.c
index 03dd576e6..59fd7c0b1 100644
--- a/kernel/lib/assoc_array.c
+++ b/kernel/lib/assoc_array.c
@@ -524,7 +524,9 @@ static bool assoc_array_insert_into_terminal_node(struct assoc_array_edit *edit,
free_slot = i;
continue;
}
- if (ops->compare_object(assoc_array_ptr_to_leaf(ptr), index_key)) {
+ if (assoc_array_ptr_is_leaf(ptr) &&
+ ops->compare_object(assoc_array_ptr_to_leaf(ptr),
+ index_key)) {
pr_devel("replace in slot %d\n", i);
edit->leaf_p = &node->slots[i];
edit->dead_leaf = node->slots[i];