Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e577e8b authored by Christoph Lameter's avatar Christoph Lameter Committed by Pekka Enberg
Browse files

slub: When allocating a new slab also prep the first object



We need to branch to the debug code for the first object if we allocate
a new slab otherwise the first object will be marked wrongly as inactive.

Tested-by: default avatarRabin Vincent <rabin@rab.in>
Signed-off-by: default avatarChristoph Lameter <cl@linux.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent 1d07171c
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -2082,6 +2082,9 @@ new_slab:
		stat(s, ALLOC_SLAB);
		stat(s, ALLOC_SLAB);
		c->node = page_to_nid(page);
		c->node = page_to_nid(page);
		c->page = page;
		c->page = page;

		if (kmem_cache_debug(s))
			goto debug;
		goto load_freelist;
		goto load_freelist;
	}
	}
	if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())
	if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())