Skip to content

Commit f4930de

Browse files
Matthew Wilcox (Oracle)tehcaster
authored andcommitted
slab: Remove dead code in free_consistency_checks()
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) <[email protected]> Reviewed-by: Harry Yoo <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent 41534d4 commit f4930de

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

mm/slub.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,10 +1684,7 @@ static inline int free_consistency_checks(struct kmem_cache *s,
16841684
return 0;
16851685

16861686
if (unlikely(s != slab->slab_cache)) {
1687-
if (!folio_test_slab(slab_folio(slab))) {
1688-
slab_err(s, slab, "Attempt to free object(0x%p) outside of slab",
1689-
object);
1690-
} else if (!slab->slab_cache) {
1687+
if (!slab->slab_cache) {
16911688
slab_err(NULL, slab, "No slab cache for object 0x%p",
16921689
object);
16931690
} else {

0 commit comments

Comments
 (0)