diff --git a/lib/radix-tree.c b/lib/radix-tree.c index bc03ecc4dfd2..e5cab5c4e383 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -2172,7 +2172,7 @@ void __rcu **idr_get_free(struct radix_tree_root *root, offset = radix_tree_find_next_bit(node, IDR_FREE, offset + 1); start = next_index(start, node, offset); - if (start > max) + if (start > max || start == 0) return ERR_PTR(-ENOSPC); while (offset == RADIX_TREE_MAP_SIZE) { offset = node->offset + 1;