summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nandsim.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-11-04 20:07:40 -0700
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-12-03 16:27:29 +0000
commit309b5e4e4154721f8079bc250d2233fd4b3aa039 (patch)
treeb004e9ff14c82a247e34e6050d1477ac750f7c54 /drivers/mtd/nand/nandsim.c
parent08b3af3092bb2c284796e4e823c5309c2d0a9bca (diff)
downloadlinux-309b5e4e4154721f8079bc250d2233fd4b3aa039.tar.gz
linux-309b5e4e4154721f8079bc250d2233fd4b3aa039.tar.bz2
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;
}