f2fs: replace count*size kzalloc by kcalloc
authorFabian Frederick <fabf@skynet.be>
Mon, 23 Jun 2014 16:39:15 +0000 (18:39 +0200)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 9 Jul 2014 21:04:25 +0000 (14:04 -0700)
kcalloc manages count*sizeof overflow.

Cc: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Cc: linux-f2fs-devel@lists.sourceforge.net
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c

index d04613df710a7e7b54db01e44ab40c3fabc460e7..a4f8375f6ae6a2c8ba095acd77393932fd4a2b65 100644 (file)
@@ -1703,7 +1703,7 @@ static int build_curseg(struct f2fs_sb_info *sbi)
        struct curseg_info *array;
        int i;
 
-       array = kzalloc(sizeof(*array) * NR_CURSEG_TYPE, GFP_KERNEL);
+       array = kcalloc(NR_CURSEG_TYPE, sizeof(*array), GFP_KERNEL);
        if (!array)
                return -ENOMEM;