projects
/
oweals
/
openwrt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc43f75
)
mtd: fix erase handling with partition offset on write
author
Felix Fietkau
<nbd@nbd.name>
Fri, 20 Apr 2018 08:02:28 +0000
(10:02 +0200)
committer
Felix Fietkau
<nbd@nbd.name>
Fri, 20 Apr 2018 08:03:38 +0000
(10:03 +0200)
When a partition offset is given, it is used in an lseek call, which
affects write, but not erase. Add it to the offset for erase calls as
well
Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/system/mtd/src/mtd.c
patch
|
blob
|
history
diff --git
a/package/system/mtd/src/mtd.c
b/package/system/mtd/src/mtd.c
index 55a3bdba8105dea7c6260b32e2f652c9225a1861..fa04c0f95b91b8878cf57df8b0e824ccf9bf4f8f 100644
(file)
--- a/
package/system/mtd/src/mtd.c
+++ b/
package/system/mtd/src/mtd.c
@@
-638,7
+638,7
@@
resume:
continue;
}
- if (mtd_erase_block(fd, e) < 0) {
+ if (mtd_erase_block(fd, e
+ part_offset
) < 0) {
if (next) {
if (w < e) {
write(fd, buf + offset, e - w);