summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nandsim.c
diff options
context:
space:
mode:
authorJoe Perches2010-11-05 04:07:40 +0100
committerDavid Woodhouse2010-12-03 17:27:29 +0100
commit309b5e4e4154721f8079bc250d2233fd4b3aa039 (patch)
treeb004e9ff14c82a247e34e6050d1477ac750f7c54 /drivers/mtd/nand/nandsim.c
parentmtd: OneNAND: Fix page offset handling at 2KiB pagesize (diff)
downloadkernel-qcow2-linux-309b5e4e4154721f8079bc250d2233fd4b3aa039.tar.gz
kernel-qcow2-linux-309b5e4e4154721f8079bc250d2233fd4b3aa039.tar.xz
kernel-qcow2-linux-309b5e4e4154721f8079bc250d2233fd4b3aa039.zip
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)
err = -EINVAL;
goto err_close;
}
- ns->pages_written = vmalloc(ns->geom.pgnum);
+ ns->pages_written = vzalloc(ns->geom.pgnum);
if (!ns->pages_written) {
NS_ERR("alloc_device: unable to allocate pages written array\n");
err = -ENOMEM;
@@ -483,7 +483,6 @@ static int alloc_device(struct nandsim *ns)
goto err_free;
}
ns->cfile = cfile;
- memset(ns->pages_written, 0, ns->geom.pgnum);
return 0;
}