diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 11:30:18 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 11:30:18 -0800 |
commit | 4582a30c2fdca5d2b40f63a20ea082b93230ff2b (patch) | |
tree | 59b00fb987c806cdf8164ae07ff229f156a210d8 /drivers/mtd/ubi/scan.c | |
parent | 9cc0cb3c7d54f320b9eede6f4a49072ecadd864d (diff) | |
parent | 6e9065d756df5dac6dc02b94b82b4f5dbbf38caf (diff) | |
download | linux-4582a30c2fdca5d2b40f63a20ea082b93230ff2b.tar.bz2 |
Merge git://git.infradead.org/ubi-2.6
* git://git.infradead.org/ubi-2.6:
UBI: add write checking
UBI: simplify debugging return codes
UBI: fix attaching error path
UBI: support attaching by MTD character device name
UBI: mark few variables as __initdata
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r-- | drivers/mtd/ubi/scan.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index 90af61a2c3e4..594184bbd56a 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c @@ -974,11 +974,8 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi) seb->ec = si->mean_ec; err = paranoid_check_si(ubi, si); - if (err) { - if (err > 0) - err = -EINVAL; + if (err) goto out_vidh; - } ubi_free_vid_hdr(ubi, vidh); kfree(ech); @@ -1086,8 +1083,8 @@ void ubi_scan_destroy_si(struct ubi_scan_info *si) * @ubi: UBI device description object * @si: scanning information * - * This function returns zero if the scanning information is all right, %1 if - * not and a negative error code if an error occurred. + * This function returns zero if the scanning information is all right, and a + * negative error code if not or if an error occurred. */ static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si) { @@ -1346,7 +1343,7 @@ bad_vid_hdr: out: ubi_dbg_dump_stack(); - return 1; + return -EINVAL; } #endif /* CONFIG_MTD_UBI_DEBUG_PARANOID */ |