]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - lib/radix-tree.c
idr: Fix idr_alloc_u32 on 32-bit systems
[mirror_ubuntu-bionic-kernel.git] / lib / radix-tree.c
index 434b3270ca4556eb5303021bbaeeaab8544757e6..7c92df492c6fbf7fc9e1fa547be3fbbd49628c2d 100644 (file)
@@ -2180,7 +2180,7 @@ void __rcu **idr_get_free_cmn(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;