]> www.infradead.org Git - users/hch/misc.git/commitdiff
slab: Remove dead code in free_consistency_checks()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 15 Sep 2025 13:55:08 +0000 (15:55 +0200)
committerVlastimil Babka <vbabka@suse.cz>
Mon, 15 Sep 2025 14:10:10 +0000 (16:10 +0200)
We already know that slab is a valid slab as that's checked by the
caller.  In the future, we won't be able to get to a slab pointer
from a non-slab page.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slub.c

index 3062f56bf49882538ba5af407de9f69c451f2e29..56143bfd1ae319d384981c810a5ed84af00f4afa 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1684,10 +1684,7 @@ static inline int free_consistency_checks(struct kmem_cache *s,
                return 0;
 
        if (unlikely(s != slab->slab_cache)) {
-               if (!folio_test_slab(slab_folio(slab))) {
-                       slab_err(s, slab, "Attempt to free object(0x%p) outside of slab",
-                                object);
-               } else if (!slab->slab_cache) {
+               if (!slab->slab_cache) {
                        slab_err(NULL, slab, "No slab cache for object 0x%p",
                                 object);
                } else {