Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7e9728f authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle)
Browse files

idr: Fix idr_alloc_u32 on 32-bit systems



Attempting to allocate an entry at 0xffffffff when one is already
present would succeed in allocating one at 2^32, which would confuse
everything.  Return -ENOSPC in this case, as expected.

Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
parent f6341c5a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1529,7 +1529,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;