Skip to content

Commit

Permalink
fs/ocfs2/slot_map.c: 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>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Fabian Frederick authored and Linus Torvalds committed Aug 7, 2014
1 parent bba1cb1 commit 1b7f8ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ocfs2/slot_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ static int ocfs2_map_slot_buffers(struct ocfs2_super *osb,

trace_ocfs2_map_slot_buffers(bytes, si->si_blocks);

si->si_bh = kzalloc(sizeof(struct buffer_head *) * si->si_blocks,
si->si_bh = kcalloc(si->si_blocks, sizeof(struct buffer_head *),
GFP_KERNEL);
if (!si->si_bh) {
status = -ENOMEM;
Expand Down

0 comments on commit 1b7f8ba

Please sign in to comment.