diff options
author | Joe Perches <joe@perches.com> | 2010-11-04 20:07:40 -0700 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-12-03 16:27:29 +0000 |
commit | 309b5e4e4154721f8079bc250d2233fd4b3aa039 (patch) | |
tree | b004e9ff14c82a247e34e6050d1477ac750f7c54 /drivers/mtd/nand/nandsim.c | |
parent | 08b3af3092bb2c284796e4e823c5309c2d0a9bca (diff) | |
download | lwn-309b5e4e4154721f8079bc250d2233fd4b3aa039.tar.gz lwn-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.c | 3 |
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; } |