diff options
-rw-r--r-- | drivers/mtd/inftlmount.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c index ecac0e438f49..b8917beeb650 100644 --- a/drivers/mtd/inftlmount.c +++ b/drivers/mtd/inftlmount.c | |||
@@ -580,14 +580,13 @@ int INFTL_mount(struct INFTLrecord *s) | |||
580 | logical_block = block = BLOCK_NIL; | 580 | logical_block = block = BLOCK_NIL; |
581 | 581 | ||
582 | /* Temporary buffer to store ANAC numbers. */ | 582 | /* Temporary buffer to store ANAC numbers. */ |
583 | ANACtable = kmalloc(s->nb_blocks * sizeof(u8), GFP_KERNEL); | 583 | ANACtable = kcalloc(s->nb_blocks, sizeof(u8), GFP_KERNEL); |
584 | if (!ANACtable) { | 584 | if (!ANACtable) { |
585 | printk(KERN_WARNING "INFTL: allocation of ANACtable " | 585 | printk(KERN_WARNING "INFTL: allocation of ANACtable " |
586 | "failed (%zd bytes)\n", | 586 | "failed (%zd bytes)\n", |
587 | s->nb_blocks * sizeof(u8)); | 587 | s->nb_blocks * sizeof(u8)); |
588 | return -ENOMEM; | 588 | return -ENOMEM; |
589 | } | 589 | } |
590 | memset(ANACtable, 0, s->nb_blocks); | ||
591 | 590 | ||
592 | /* | 591 | /* |
593 | * First pass is to explore each physical unit, and construct the | 592 | * First pass is to explore each physical unit, and construct the |