fs/exofs/ore_raid.c: replace count*size kzalloc by kcalloc
authorFabian Frederick <fabf@skynet.be>
Fri, 8 Aug 2014 21:22:18 +0000 (14:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Aug 2014 22:57:24 +0000 (15:57 -0700)
kcalloc manages count*sizeof overflow.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Acked-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/exofs/ore_raid.c

index 7f20f25c232c453d631b817ad382d27fea83fba3..84529b8a331b1402e3a4662a1f4ce90c4dc185b6 100644 (file)
@@ -116,7 +116,7 @@ static int _sp2d_alloc(unsigned pages_in_unit, unsigned group_width,
                        num_a1pa = min_t(unsigned, PAGE_SIZE / sizeof__a1pa,
                                                        pages_in_unit - i);
 
-                       __a1pa = kzalloc(num_a1pa * sizeof__a1pa, GFP_KERNEL);
+                       __a1pa = kcalloc(num_a1pa, sizeof__a1pa, GFP_KERNEL);
                        if (unlikely(!__a1pa)) {
                                ORE_DBGMSG("!! Failed to _alloc_1p_arrays=%d\n",
                                           num_a1pa);