projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ebf2e93
)
mtd: mtdpart: prevent a read from regions[-1]
author
Roel Kluin
<roel.kluin@gmail.com>
Fri, 18 Sep 2009 19:51:50 +0000
(12:51 -0700)
committer
David Woodhouse
<David.Woodhouse@intel.com>
Sat, 19 Sep 2009 18:23:26 +0000
(11:23 -0700)
If the erase region was found in the first iteration we read from
regions[-1]
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/mtdpart.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/mtd/mtdpart.c
b/drivers/mtd/mtdpart.c
index 349fcbe5cc0ff2718c7372bf3263b17a7af3c8d3..a83cfa1ad122b3a0d6ac3134ccfbbc27dd6ef865 100644
(file)
--- a/
drivers/mtd/mtdpart.c
+++ b/
drivers/mtd/mtdpart.c
@@
-453,7
+453,8
@@
static struct mtd_part *add_one_partition(struct mtd_info *master,
for (i = 0; i < max && regions[i].offset <= slave->offset; i++)
;
/* The loop searched for the region _behind_ the first one */
- i--;
+ if (i > 0)
+ i--;
/* Pick biggest erasesize */
for (; i < max && regions[i].offset < end; i++) {