Skip to content

Commit

Permalink
UBI: Fix invalidate_fastmap()
Browse files Browse the repository at this point in the history
Onging tests uncovered that invalidate_fastmap() is broken.
It must not call ubi_wl_put_fm_peb() because all PEBs used
by the old fastmap have already been put back.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
Richard Weinberger authored and Artem Bityutskiy committed Aug 20, 2013
1 parent 5ef4414 commit 8930fa5
Showing 1 changed file with 1 addition 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

0 comments on commit 8930fa5

Please sign in to comment.