]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
maple_tree: remove a BUG_ON() in mas_alloc_nodes()
authorPetr Tesarik <ptesarik@suse.com>
Thu, 13 Feb 2025 11:44:53 +0000 (12:44 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 17 Mar 2025 05:06:15 +0000 (22:06 -0700)
Remove a BUG_ON() right before a WARN_ON() with the same condition.

Calling WARN_ON() and BUG_ON() here is definitely wrong.  Since the goal is
generally to remove BUG_ON() invocations from the kernel, keep only the
WARN_ON().

Link: https://lkml.kernel.org/r/20250213114453.1078318-1-ptesarik@suse.com
Fixes: 067311d33e65 ("maple_tree: separate ma_state node from status")
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c

index 60356ccb11ce1bc40be1db8357a6e923b2f8424e..d0bea23fa4bc9fdd0ca4803a108d3c943f6a0c73 100644 (file)
@@ -1242,7 +1242,6 @@ static inline void mas_alloc_nodes(struct ma_state *mas, gfp_t gfp)
        if (mas->mas_flags & MA_STATE_PREALLOC) {
                if (allocated)
                        return;
-               BUG_ON(!allocated);
                WARN_ON(!allocated);
        }