]> git.karo-electronics.de Git - linux-beck.git/commitdiff
UBIFS: replace count*size kzalloc by kcalloc
authorFabian Frederick <fabf@skynet.be>
Mon, 23 Jun 2014 16:41:23 +0000 (18:41 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Sat, 19 Jul 2014 06:53:52 +0000 (09:53 +0300)
kcalloc manages count*sizeof overflow.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
fs/ubifs/super.c

index 3b0c2c0b389fc98ccf8a508f887219e0374e4b7c..177dd629d88fbf60a2aa335c2ba5eba0de015833 100644 (file)
@@ -796,8 +796,8 @@ static int alloc_wbufs(struct ubifs_info *c)
 {
        int i, err;
 
-       c->jheads = kzalloc(c->jhead_cnt * sizeof(struct ubifs_jhead),
-                          GFP_KERNEL);
+       c->jheads = kcalloc(c->jhead_cnt, sizeof(struct ubifs_jhead),
+                           GFP_KERNEL);
        if (!c->jheads)
                return -ENOMEM;