aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r--drivers/mtd/ubi/scan.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index 90af61a2c3e4..dc5f688699da 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -41,6 +41,7 @@
41 */ 41 */
42 42
43#include <linux/err.h> 43#include <linux/err.h>
44#include <linux/slab.h>
44#include <linux/crc32.h> 45#include <linux/crc32.h>
45#include <linux/math64.h> 46#include <linux/math64.h>
46#include "ubi.h" 47#include "ubi.h"
@@ -974,11 +975,8 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi)
974 seb->ec = si->mean_ec; 975 seb->ec = si->mean_ec;
975 976
976 err = paranoid_check_si(ubi, si); 977 err = paranoid_check_si(ubi, si);
977 if (err) { 978 if (err)
978 if (err > 0)
979 err = -EINVAL;
980 goto out_vidh; 979 goto out_vidh;
981 }
982 980
983 ubi_free_vid_hdr(ubi, vidh); 981 ubi_free_vid_hdr(ubi, vidh);
984 kfree(ech); 982 kfree(ech);
@@ -1086,8 +1084,8 @@ void ubi_scan_destroy_si(struct ubi_scan_info *si)
1086 * @ubi: UBI device description object 1084 * @ubi: UBI device description object
1087 * @si: scanning information 1085 * @si: scanning information
1088 * 1086 *
1089 * This function returns zero if the scanning information is all right, %1 if 1087 * This function returns zero if the scanning information is all right, and a
1090 * not and a negative error code if an error occurred. 1088 * negative error code if not or if an error occurred.
1091 */ 1089 */
1092static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si) 1090static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si)
1093{ 1091{
@@ -1346,7 +1344,7 @@ bad_vid_hdr:
1346 1344
1347out: 1345out:
1348 ubi_dbg_dump_stack(); 1346 ubi_dbg_dump_stack();
1349 return 1; 1347 return -EINVAL;
1350} 1348}
1351 1349
1352#endif /* CONFIG_MTD_UBI_DEBUG_PARANOID */ 1350#endif /* CONFIG_MTD_UBI_DEBUG_PARANOID */