aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nandsim.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-11-04 23:07:40 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-12-03 11:27:29 -0500
commit309b5e4e4154721f8079bc250d2233fd4b3aa039 (patch)
treeb004e9ff14c82a247e34e6050d1477ac750f7c54 /drivers/mtd/nand/nandsim.c
parent08b3af3092bb2c284796e4e823c5309c2d0a9bca (diff)
mtd: use vzalloc
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/nandsim.c')
-rw-r--r--drivers/mtd/nand/nandsim.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index c45e06fba154..a5aa99f014ba 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -470,7 +470,7 @@ static int alloc_device(struct nandsim *ns)
470 err = -EINVAL; 470 err = -EINVAL;
471 goto err_close; 471 goto err_close;
472 } 472 }
473 ns->pages_written = vmalloc(ns->geom.pgnum); 473 ns->pages_written = vzalloc(ns->geom.pgnum);
474 if (!ns->pages_written) { 474 if (!ns->pages_written) {
475 NS_ERR("alloc_device: unable to allocate pages written array\n"); 475 NS_ERR("alloc_device: unable to allocate pages written array\n");
476 err = -ENOMEM; 476 err = -ENOMEM;
@@ -483,7 +483,6 @@ static int alloc_device(struct nandsim *ns)
483 goto err_free; 483 goto err_free;
484 } 484 }
485 ns->cfile = cfile; 485 ns->cfile = cfile;
486 memset(ns->pages_written, 0, ns->geom.pgnum);
487 return 0; 486 return 0;
488 } 487 }
489 488