projects
/
platform
/
upstream
/
kernel-adaptation-pc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2f9270e
)
UBI: add sanity check
author
Artem Bityutskiy
<Artem.Bityutskiy@nokia.com>
Tue, 22 Jan 2008 10:38:15 +0000
(12:38 +0200)
committer
Artem Bityutskiy
<Artem.Bityutskiy@nokia.com>
Fri, 25 Jan 2008 14:41:25 +0000
(16:41 +0200)
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/ubi/scan.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/ubi/scan.c
b/drivers/mtd/ubi/scan.c
index
0c05f7b
..
e476638
100644
(file)
--- a/
drivers/mtd/ubi/scan.c
+++ b/
drivers/mtd/ubi/scan.c
@@
-286,9
+286,14
@@
static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb,
* FIXME: but this is anyway obsolete and will be removed at
* some point.
*/
-
dbg_bld("using old crappy leb_ver stuff");
+ if (v1 == v2) {
+ ubi_err("PEB %d and PEB %d have the same version %lld",
+ seb->pnum, pnum, v1);
+ return -EINVAL;
+ }
+
abs = v1 - v2;
if (abs < 0)
abs = -abs;