From: Fabian Frederick <fabf@skynet.be>
Date: Mon, 23 Jun 2014 16:41:23 +0000 (+0200)
Subject: UBIFS: replace count*size kzalloc by kcalloc
X-Git-Tag: firefly_0821_release~176^2~3411^2~12
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=86b4c14de34d19ec3fc4662761feed9918491658;p=firefly-linux-kernel-4.4.55.git

UBIFS: replace count*size kzalloc by kcalloc

kcalloc manages count*sizeof overflow.

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

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 3b0c2c0b389f..177dd629d88f 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -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;