aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDev Jain <[email protected]>2025-06-24 08:07:48 +0000
committerAndrew Morton <[email protected]>2025-07-10 05:42:19 +0000
commit592b939b59b43a817ce6d79900793982d452bb5d (patch)
tree7de541d2a826ef4ad2c2d8a8139d319cf563f8bf
parentselftets/damon: add a test for memcg_path leak (diff)
downloadkernel-592b939b59b43a817ce6d79900793982d452bb5d.tar.gz
kernel-592b939b59b43a817ce6d79900793982d452bb5d.zip
maple tree: use goto label to simplify code
Use the underflow goto label to set the status to ma_underflow and return NULL, as is being done elsewhere. [[email protected]: add newline, per Liam (and remove one, per akpm)] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Dev Jain <[email protected]> Reviewed-by: Liam R. Howlett <[email protected]> Reviewed-by: Wei Yang <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--lib/maple_tree.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index 00524e55a21e..34b84b14985e 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -4560,15 +4560,12 @@ again:
if (unlikely(mas_rewalk_if_dead(mas, node, save_point)))
goto retry;
-
if (likely(entry))
return entry;
if (!empty) {
- if (mas->index <= min) {
- mas->status = ma_underflow;
- return NULL;
- }
+ if (mas->index <= min)
+ goto underflow;
goto again;
}