cmd: android: round up image header size

Change-Id: I79e1b31ae2d018c0a8da030482f2ac0be44cb177
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen 2019-08-30 09:44:06 +08:00 committed by Jianhong Chen
parent 888e59c91d
commit df3ff3726e
1 changed files with 2 additions and 2 deletions

View File

@ -37,13 +37,13 @@ static int do_android_print_hdr(cmd_tbl_t *cmdtp, int flag,
return -ENODEV;
}
hdr = memalign(ARCH_DMA_MINALIGN, sizeof(*hdr));
blkcnt = DIV_ROUND_UP(sizeof(*hdr), dev_desc->blksz);
hdr = memalign(ARCH_DMA_MINALIGN, dev_desc->blksz * blkcnt);
if (!hdr) {
printf("%s: out of memory!\n", __func__);
return -ENOMEM;
}
blkcnt = sizeof(*hdr) / dev_desc->blksz;
ret = blk_dread(dev_desc, part_info.start, blkcnt, hdr);
if (ret != blkcnt) {
printf("Failed to read %s sector, ret=%d\n", part_info.name, ret);