summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi
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/ubi
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/ubi')
-rw-r--r--drivers/mtd/ubi/vtbl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index fcdb7f65fe0b..0b8141fc5c26 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -425,12 +425,11 @@ static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
/* Read both LEB 0 and LEB 1 into memory */
ubi_rb_for_each_entry(rb, seb, &sv->root, u.rb) {
- leb[seb->lnum] = vmalloc(ubi->vtbl_size);
+ leb[seb->lnum] = vzalloc(ubi->vtbl_size);
if (!leb[seb->lnum]) {
err = -ENOMEM;
goto out_free;
}
- memset(leb[seb->lnum], 0, ubi->vtbl_size);
err = ubi_io_read_data(ubi, leb[seb->lnum], seb->pnum, 0,
ubi->vtbl_size);
@@ -516,10 +515,9 @@ static struct ubi_vtbl_record *create_empty_lvol(struct ubi_device *ubi,
int i;
struct ubi_vtbl_record *vtbl;
- vtbl = vmalloc(ubi->vtbl_size);
+ vtbl = vzalloc(ubi->vtbl_size);
if (!vtbl)
return ERR_PTR(-ENOMEM);
- memset(vtbl, 0, ubi->vtbl_size);
for (i = 0; i < ubi->vtbl_slots; i++)
memcpy(&vtbl[i], &empty_vtbl_record, UBI_VTBL_RECORD_SIZE);