diff options
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) | |||
| 974 | seb->ec = si->mean_ec; | 974 | seb->ec = si->mean_ec; |
| 975 | 975 | ||
| 976 | err = paranoid_check_si(ubi, si); | 976 | err = paranoid_check_si(ubi, si); |
| 977 | if (err) { | 977 | if (err) |
| 978 | if (err > 0) | ||
| 979 | err = -EINVAL; | ||
| 980 | goto out_vidh; | 978 | goto out_vidh; |
| 981 | } | ||
| 982 | 979 | ||
| 983 | ubi_free_vid_hdr(ubi, vidh); | 980 | ubi_free_vid_hdr(ubi, vidh); |
| 984 | kfree(ech); | 981 | kfree(ech); |
| @@ -1086,8 +1083,8 @@ void ubi_scan_destroy_si(struct ubi_scan_info *si) | |||
| 1086 | * @ubi: UBI device description object | 1083 | * @ubi: UBI device description object |
| 1087 | * @si: scanning information | 1084 | * @si: scanning information |
| 1088 | * | 1085 | * |
| 1089 | * This function returns zero if the scanning information is all right, %1 if | 1086 | * This function returns zero if the scanning information is all right, and a |
| 1090 | * not and a negative error code if an error occurred. | 1087 | * negative error code if not or if an error occurred. |
| 1091 | */ | 1088 | */ |
| 1092 | static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si) | 1089 | static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si) |
| 1093 | { | 1090 | { |
| @@ -1346,7 +1343,7 @@ bad_vid_hdr: | |||
| 1346 | 1343 | ||
| 1347 | out: | 1344 | out: |
| 1348 | ubi_dbg_dump_stack(); | 1345 | ubi_dbg_dump_stack(); |
| 1349 | return 1; | 1346 | return -EINVAL; |
| 1350 | } | 1347 | } |
| 1351 | 1348 | ||
| 1352 | #endif /* CONFIG_MTD_UBI_DEBUG_PARANOID */ | 1349 | #endif /* CONFIG_MTD_UBI_DEBUG_PARANOID */ |
