mtd: fix erase handling with partition offset on write
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>
This commit is contained in:
parent
bc43f75def
commit
d92ec071b2
1 changed files with 1 additions and 1 deletions
|
@ -638,7 +638,7 @@ resume:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mtd_erase_block(fd, e) < 0) {
|
if (mtd_erase_block(fd, e + part_offset) < 0) {
|
||||||
if (next) {
|
if (next) {
|
||||||
if (w < e) {
|
if (w < e) {
|
||||||
write(fd, buf + offset, e - w);
|
write(fd, buf + offset, e - w);
|
||||||
|
|
Loading…
Reference in a new issue