]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - tools/env/fw_env.c
fw_env: correct writes to devices with small erase blocks
[karo-tx-uboot.git] / tools / env / fw_env.c
index 649db0493a957e83362401f2ad6bdf92652e3ecc..d228cc34da8637444ee3264597f33bf7a634dfae 100644 (file)
@@ -863,9 +863,9 @@ static int flash_write_buf (int dev, int fd, void *buf, size_t count,
                if (mtd_type != MTD_ABSENT)
                        ioctl(fd, MEMLOCK, &erase);
 
-               processed  += blocklen;
+               processed  += erasesize;
                block_seek = 0;
-               blockstart += blocklen;
+               blockstart += erasesize;
        }
 
        if (write_total > count)