Skip to content

Commit

Permalink
Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6
Browse files Browse the repository at this point in the history
* 'linux-next' of git://git.infradead.org/ubi-2.6:
  UBI: release locks in check_corruption
  • Loading branch information
Linus Torvalds committed Nov 26, 2010
2 parents 0318755 + 1b1d76e commit 1eb4c63
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions drivers/mtd/ubi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,16 +787,15 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr,
* erased, so it became unstable and corrupted, and should be
* erased.
*/
return 0;
err = 0;
goto out_unlock;
}

if (err)
return err;
goto out_unlock;

if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size)) {
mutex_unlock(&ubi->buf_mutex);
return 0;
}
if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size))
goto out_unlock;

ubi_err("PEB %d contains corrupted VID header, and the data does not "
"contain all 0xFF, this may be a non-UBI PEB or a severe VID "
Expand All @@ -806,8 +805,11 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr,
pnum, ubi->leb_start, ubi->leb_size);
ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,
ubi->peb_buf1, ubi->leb_size, 1);
err = 1;

out_unlock:
mutex_unlock(&ubi->buf_mutex);
return 1;
return err;
}

/**
Expand Down

0 comments on commit 1eb4c63

Please sign in to comment.