X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmtd%2Finftlmount.c;h=b8917beeb65099262da1e316282d663e43933e39;hb=6f157c1d268d5888ca44c589dccd01729c4172f6;hp=acf3ba223298e2ff06ba79a769bd1a8ffb7a7911;hpb=f99c6bb6e2e9c35bd3dc0b1d0faa28bd6970930d;p=linux-2.6 diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c index acf3ba2232..b8917beeb6 100644 --- a/drivers/mtd/inftlmount.c +++ b/drivers/mtd/inftlmount.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -581,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