Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231670
b: refs/heads/master
c: 309b5e4
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and David Woodhouse committed Dec 3, 2010
1 parent b9ce933 commit 41e32d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08b3af3092bb2c284796e4e823c5309c2d0a9bca
refs/heads/master: 309b5e4e4154721f8079bc250d2233fd4b3aa039
3 changes: 1 addition & 2 deletions trunk/drivers/mtd/nand/nandsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/mtd/ubi/vtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 41e32d0

Please sign in to comment.