diff --git a/lib/stackdepot.c b/lib/stackdepot.c index c043a4186bc5..c1ec2b4b6dab 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -490,7 +490,7 @@ static struct stack_record *depot_fetch_stack(depot_stack_handle_t handle) lockdep_assert_not_held(&pool_lock); - if (pool_index > pools_num_cached) { + if (pool_index >= pools_num_cached) { WARN(1, "pool index %d out of bounds (%d) for stack id %08x\n", pool_index, pools_num_cached, handle); return NULL;