Skip to content

Commit

Permalink
[MTD] drivers/mtd/inftlmount.c: kmalloc + memset conversion to kcalloc
Browse files Browse the repository at this point in the history
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
Mariusz Kozlowski authored and David Woodhouse committed Aug 1, 2007
1 parent 8f0f23f commit d67d1d7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/mtd/inftlmount.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,14 +580,13 @@ int INFTL_mount(struct INFTLrecord *s)
logical_block = block = BLOCK_NIL;

/* Temporary buffer to store ANAC numbers. */
ANACtable = kmalloc(s->nb_blocks * sizeof(u8), GFP_KERNEL);
ANACtable = kcalloc(s->nb_blocks, sizeof(u8), GFP_KERNEL);
if (!ANACtable) {
printk(KERN_WARNING "INFTL: allocation of ANACtable "
"failed (%zd bytes)\n",
s->nb_blocks * sizeof(u8));
return -ENOMEM;
}
memset(ANACtable, 0, s->nb_blocks);

/*
* First pass is to explore each physical unit, and construct the
Expand Down

0 comments on commit d67d1d7

Please sign in to comment.