summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/scan.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-03-16 00:23:54 +0100
committerDavid S. Miller <davem@davemloft.net>2010-03-16 00:23:54 +0100
commit4961e02f1999e1c3468c09b2669c94d7c3ae82a8 (patch)
tree44c15abb09d7ba5e17a9aba95ee246648b1c1a8a /drivers/mtd/ubi/scan.c
parentnet-2.6 [Bug-Fix][dccp]: fix oops caused after failed initialisation (diff)
parentMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/... (diff)
downloadlinux-4961e02f1999e1c3468c09b2669c94d7c3ae82a8.tar.xz
linux-4961e02f1999e1c3468c09b2669c94d7c3ae82a8.zip
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r--drivers/mtd/ubi/scan.c11
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 */