Skip to content

Commit

Permalink
Merge tag 'upstream-3.12-rc1' of git://git.infradead.org/linux-ubi
Browse files Browse the repository at this point in the history
Pull UBI fixes from Artem Bityutskiy:
 "Just a single fastmap fix plus a regression fix"

* tag 'upstream-3.12-rc1' of git://git.infradead.org/linux-ubi:
  UBI: Fix invalidate_fastmap()
  UBI: Fix PEB leak in wear_leveling_worker()
  • Loading branch information
torvalds committed Sep 16, 2013
2 parents 098e7f1 + 8930fa5 commit f1da345
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/mtd/ubi/fastmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ static int erase_block(struct ubi_device *ubi, int pnum)
static int invalidate_fastmap(struct ubi_device *ubi,
struct ubi_fastmap_layout *fm)
{
int ret, i;
int ret;
struct ubi_vid_hdr *vh;

ret = erase_block(ubi, fm->e[0]->pnum);
Expand All @@ -1360,9 +1360,6 @@ static int invalidate_fastmap(struct ubi_device *ubi,
vh->sqnum = cpu_to_be64(ubi_next_sqnum(ubi));
ret = ubi_io_write_vid_hdr(ubi, fm->e[0]->pnum, vh);

for (i = 0; i < fm->used_blocks; i++)
ubi_wl_put_fm_peb(ubi, fm->e[i], i, fm->to_be_tortured[i]);

return ret;
}

Expand Down
3 changes: 3 additions & 0 deletions drivers/mtd/ubi/wl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,9 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
if (!(e2->ec - e1->ec >= UBI_WL_THRESHOLD)) {
dbg_wl("no WL needed: min used EC %d, max free EC %d",
e1->ec, e2->ec);

/* Give the unused PEB back */
wl_tree_add(e2, &ubi->free);
goto out_cancel;
}
self_check_in_wl_tree(ubi, e1, &ubi->used);
Expand Down

0 comments on commit f1da345

Please sign in to comment.