Skip to content

Commit

Permalink
UBIFS: replace count*size kzalloc by kcalloc
Browse files Browse the repository at this point in the history
kcalloc manages count*sizeof overflow.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
Fabian Frederick authored and Artem Bityutskiy committed Jul 19, 2014
1 parent ef13f01 commit 86b4c14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ubifs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 86b4c14

Please sign in to comment.