@@ -2427,7 +2427,7 @@ int do_ffu(int nargs, char **argv)
exit(1);
}
- buf = malloc(512);
+ buf = malloc(4096);
multi_cmd = calloc(1, sizeof(struct mmc_ioc_multi_cmd) +
3 * sizeof(struct mmc_ioc_cmd));
if (!buf || !multi_cmd) {
@@ -2510,7 +2510,7 @@ int do_ffu(int nargs, char **argv)
do_retry:
/* read firmware chunk */
lseek(img_fd, 0, SEEK_SET);
- chunk_size = read(img_fd, buf, 512);
+ chunk_size = read(img_fd, buf, sect_size);
while (chunk_size > 0) {
/* send ioctl with multi-cmd */
@@ -2548,7 +2548,7 @@ do_retry:
}
/* read the next firmware chunk (if any) */
- chunk_size = read(img_fd, buf, 512);
+ chunk_size = read(img_fd, buf, sect_size);
}
if ((sect_done * sect_size) == fw_size) {
Read firmware image in chunch of sect_size bytes, to support non 512B sector size. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> --- mmc_cmds.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)