From: Matthew Wilcox Date: Sat, 8 Dec 2018 10:47:06 +0000 (-0500) Subject: maple_tree: Change kcalloc to kzalloc X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8860cb377679d1e3afb6993f2498a72779b27fa0;p=users%2Fjedix%2Flinux-maple.git maple_tree: Change kcalloc to kzalloc We were allocating too much memory here. Found by inspection, and I can't think of a way to write a test to catch this class of problem. Signed-off-by: Matthew Wilcox --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index a1f0c041add7..019d55558173 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -129,7 +129,7 @@ static void maple_new_node(struct maple_state *ms, int count, gfp_t gfp) mn = ma_get_alloc(ms); if (!mn) - mn = kcalloc(count, sizeof(*mn), gfp); + mn = kzalloc(sizeof(*mn), gfp); if (!mn) goto list_failed;