diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-16 15:37:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-16 15:37:52 -0400 |
commit | f1da3458e9d915d72b0dd30a7c41c3aff8f03589 (patch) | |
tree | 06221f0a766f6de14e9c1eaf48e4d80fbfcc12c4 /drivers/mtd | |
parent | 098e7f1665f1a3503524bdd537499e45ad30e67d (diff) | |
parent | 8930fa500f55215f0211db9b78255e727ac3f282 (diff) |
Merge tag 'upstream-3.12-rc1' of git://git.infradead.org/linux-ubi
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()
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/ubi/fastmap.c | 5 | ||||
-rw-r--r-- | drivers/mtd/ubi/wl.c | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index 154275182b4b..f5aa4b02cfa6 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c | |||
@@ -1343,7 +1343,7 @@ out: | |||
1343 | static int invalidate_fastmap(struct ubi_device *ubi, | 1343 | static int invalidate_fastmap(struct ubi_device *ubi, |
1344 | struct ubi_fastmap_layout *fm) | 1344 | struct ubi_fastmap_layout *fm) |
1345 | { | 1345 | { |
1346 | int ret, i; | 1346 | int ret; |
1347 | struct ubi_vid_hdr *vh; | 1347 | struct ubi_vid_hdr *vh; |
1348 | 1348 | ||
1349 | ret = erase_block(ubi, fm->e[0]->pnum); | 1349 | ret = erase_block(ubi, fm->e[0]->pnum); |
@@ -1360,9 +1360,6 @@ static int invalidate_fastmap(struct ubi_device *ubi, | |||
1360 | vh->sqnum = cpu_to_be64(ubi_next_sqnum(ubi)); | 1360 | vh->sqnum = cpu_to_be64(ubi_next_sqnum(ubi)); |
1361 | ret = ubi_io_write_vid_hdr(ubi, fm->e[0]->pnum, vh); | 1361 | ret = ubi_io_write_vid_hdr(ubi, fm->e[0]->pnum, vh); |
1362 | 1362 | ||
1363 | for (i = 0; i < fm->used_blocks; i++) | ||
1364 | ubi_wl_put_fm_peb(ubi, fm->e[i], i, fm->to_be_tortured[i]); | ||
1365 | |||
1366 | return ret; | 1363 | return ret; |
1367 | } | 1364 | } |
1368 | 1365 | ||
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 5df49d3cb5c7..c95bfb183c62 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c | |||
@@ -1069,6 +1069,9 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk, | |||
1069 | if (!(e2->ec - e1->ec >= UBI_WL_THRESHOLD)) { | 1069 | if (!(e2->ec - e1->ec >= UBI_WL_THRESHOLD)) { |
1070 | dbg_wl("no WL needed: min used EC %d, max free EC %d", | 1070 | dbg_wl("no WL needed: min used EC %d, max free EC %d", |
1071 | e1->ec, e2->ec); | 1071 | e1->ec, e2->ec); |
1072 | |||
1073 | /* Give the unused PEB back */ | ||
1074 | wl_tree_add(e2, &ubi->free); | ||
1072 | goto out_cancel; | 1075 | goto out_cancel; |
1073 | } | 1076 | } |
1074 | self_check_in_wl_tree(ubi, e1, &ubi->used); | 1077 | self_check_in_wl_tree(ubi, e1, &ubi->used); |