Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68500
b: refs/heads/master
c: d9b0744
h: refs/heads/master
v: v3
  • Loading branch information
Mariusz Kozlowski authored and David Woodhouse committed Aug 1, 2007
1 parent 7c31010 commit 153fefb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 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: 4fb4caa639a27a3cb0b3bfbf2041524af43efff9
refs/heads/master: d9b0744d6c75f7b268b728cdd1843f31bdeba311
17 changes: 8 additions & 9 deletions trunk/drivers/mtd/ubi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,40 +1314,39 @@ static int paranoid_check_si(const struct ubi_device *ubi,
* Make sure that all the physical eraseblocks are in one of the lists
* or trees.
*/
buf = kmalloc(ubi->peb_count, GFP_KERNEL);
buf = kzalloc(ubi->peb_count, GFP_KERNEL);
if (!buf)
return -ENOMEM;

memset(buf, 1, ubi->peb_count);
for (pnum = 0; pnum < ubi->peb_count; pnum++) {
err = ubi_io_is_bad(ubi, pnum);
if (err < 0) {
kfree(buf);
return err;
}
else if (err)
buf[pnum] = 0;
buf[pnum] = 1;
}

ubi_rb_for_each_entry(rb1, sv, &si->volumes, rb)
ubi_rb_for_each_entry(rb2, seb, &sv->root, u.rb)
buf[seb->pnum] = 0;
buf[seb->pnum] = 1;

list_for_each_entry(seb, &si->free, u.list)
buf[seb->pnum] = 0;
buf[seb->pnum] = 1;

list_for_each_entry(seb, &si->corr, u.list)
buf[seb->pnum] = 0;
buf[seb->pnum] = 1;

list_for_each_entry(seb, &si->erase, u.list)
buf[seb->pnum] = 0;
buf[seb->pnum] = 1;

list_for_each_entry(seb, &si->alien, u.list)
buf[seb->pnum] = 0;
buf[seb->pnum] = 1;

err = 0;
for (pnum = 0; pnum < ubi->peb_count; pnum++)
if (buf[pnum]) {
if (!buf[pnum]) {
ubi_err("PEB %d is not referred", pnum);
err = 1;
}
Expand Down

0 comments on commit 153fefb

Please sign in to comment.