summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/radix-tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index a9e41aed6de4..cc6096b97afb 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -120,7 +120,7 @@ bool is_sibling_entry(const struct radix_tree_node *parent, void *node)
static inline unsigned long
get_slot_offset(const struct radix_tree_node *parent, void __rcu **slot)
{
- return slot - parent->slots;
+ return parent ? slot - parent->slots : 0;
}
static unsigned int radix_tree_descend(const struct radix_tree_node *parent,