]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lib/stacktrace: drop impossible WARN_ON for depot_init_pool
authorAndrey Konovalov <andreyknvl@google.com>
Fri, 10 Feb 2023 21:16:00 +0000 (22:16 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 10 Feb 2023 23:36:12 +0000 (15:36 -0800)
commit0b2d027ba6391c27bd5c13da7a950e04c894a3c4
treedd120ad2aae9ee3a1aa4e68f0ff5d09f354bf801
parentdbf9ae86a8ec9e177e7e50ae842681294f22094b
lib/stacktrace: drop impossible WARN_ON for depot_init_pool

depot_init_pool has two call sites:

1. In depot_alloc_stack with a potentially NULL prealloc.
2. In __stack_depot_save with a non-NULL prealloc.

At the same time depot_init_pool can only return false when prealloc is
NULL.

As the second call site makes sure that prealloc is not NULL, the WARN_ON
there can never trigger. Thus, drop the WARN_ON and also move the prealloc
check from depot_init_pool to its first call site.

Also change the return type of depot_init_pool to void as it now always
returns true.

Link: https://lkml.kernel.org/r/ce149f9bdcbc80a92549b54da67eafb27f846b7b.1676063693.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/stackdepot.c