From 8860cb377679d1e3afb6993f2498a72779b27fa0 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Sat, 8 Dec 2018 05:47:06 -0500 Subject: [PATCH] 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 --- lib/maple_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index a1f0c041add7a..019d555581736 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; -- 2.50.1