]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
maple_tree: Change kcalloc to kzalloc
authorMatthew Wilcox <willy@infradead.org>
Sat, 8 Dec 2018 10:47:06 +0000 (05:47 -0500)
committerMatthew Wilcox <willy@infradead.org>
Sat, 8 Dec 2018 11:15:47 +0000 (06:15 -0500)
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 <willy@infradead.org>
lib/maple_tree.c

index a1f0c041add7a4ddd232b005e5bb38375c15ea04..019d555581736ee1c0a70a592e2602a7c76e0c43 100644 (file)
@@ -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;