cmd: android: round up image header size
Change-Id: I79e1b31ae2d018c0a8da030482f2ac0be44cb177 Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
parent
888e59c91d
commit
df3ff3726e
|
|
@ -37,13 +37,13 @@ static int do_android_print_hdr(cmd_tbl_t *cmdtp, int flag,
|
||||||
return -ENODEV;
|
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) {
|
if (!hdr) {
|
||||||
printf("%s: out of memory!\n", __func__);
|
printf("%s: out of memory!\n", __func__);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
blkcnt = sizeof(*hdr) / dev_desc->blksz;
|
|
||||||
ret = blk_dread(dev_desc, part_info.start, blkcnt, hdr);
|
ret = blk_dread(dev_desc, part_info.start, blkcnt, hdr);
|
||||||
if (ret != blkcnt) {
|
if (ret != blkcnt) {
|
||||||
printf("Failed to read %s sector, ret=%d\n", part_info.name, ret);
|
printf("Failed to read %s sector, ret=%d\n", part_info.name, ret);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue