In alloc_debug_processing() we know that the slab pointer passed in really is a pointer to a slab. Both callers modify members of the slab data structure. So we can remove this check. Signed-off-by: Matthew Wilcox (Oracle) --- mm/slub.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 2138fecc8d37..f737b85a326f 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1710,17 +1710,15 @@ static noinline bool alloc_debug_processing(struct kmem_cache *s, return true; bad: - if (folio_test_slab(slab_folio(slab))) { - /* - * If this is a slab page then lets do the best we can - * to avoid issues in the future. Marking all objects - * as used avoids touching the remaining objects. - */ - slab_fix(s, "Marking all objects used"); - slab->inuse = slab->objects; - slab->freelist = NULL; - slab->frozen = 1; /* mark consistency-failed slab as frozen */ - } + /* + * Lets do the best we can to avoid issues in the future. Marking + * all objects as used avoids touching the remaining objects. + */ + slab_fix(s, "Marking all objects used"); + slab->inuse = slab->objects; + slab->freelist = NULL; + slab->frozen = 1; /* mark consistency-failed slab as frozen */ + return false; } -- 2.47.2