maple_tree: Fix mas_empty_area() wrapping
Subsystems (3)
PATCH 1/1 maple_tree: Fix mas_empty_area() wrapping
Set the error code correctly when at the left most node and search has been exhausted. This was an overflow bug.
Reported-by Sven Schnelle <[email protected]>
Signed-off-by Liam R. Howlett <[email protected]>
--- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/maple_tree.c +1 -1
@@ -4994,7 +4994,7 @@ static inline bool mas_anode_descend(struct ma_state *mas, unsigned long size) } next_slot: min = pivot +1 ; -if (mas->last < min) { +if (mas->last <= pivot) {mas_set_err (mas, -EBUSY );return true; }
Signature · 1 line
2.35.1
Quoted 5 lines · Liam Howlett
Set the error code correctly when at the left most node and search has been exhausted. This was an overflow bug.
Reported-by Sven Schnelle <[email protected]>Signed-off-by Liam R. Howlett <[email protected]>
That fixes it, thanks!
Tested-by Sven Schnelle <[email protected]>
Quoted 17 lines
--- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/maple_tree.c +1
-1@@ -4994,7 +4994,7 @@ static inline bool mas_anode_descend(struct ma_state *mas, unsigned long size) } next_slot: min = pivot +1 ; -if (mas->last < min) { +if (mas->last <= pivot) {mas_set_err (mas, -EBUSY );return true; }