diff options
author | Tom Rini <trini@konsulko.com> | 2024-09-10 07:51:40 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-09-10 07:51:40 -0600 |
commit | ce1a2630827a1f9ddadb2598ab7936732e6cb723 (patch) | |
tree | f470da34de08daa94e5fface0235125123e16132 /boot/android_ab.c | |
parent | 40727391702a1a48c58b0a3c6e69013ff8af6cb2 (diff) | |
parent | cc2f60c13f6aaf1bd277cf10c8b375c2e4a695b7 (diff) |
Merge tag 'u-boot-dfu-20240910' of https://source.denx.de/u-boot/custodians/u-boot-dfu
CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/22302
- Fix ANDROID_AB_BACKUP_OFFSET unit
Diffstat (limited to 'boot/android_ab.c')
-rw-r--r-- | boot/android_ab.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/boot/android_ab.c b/boot/android_ab.c index 143f373aae9..1196a189ed5 100644 --- a/boot/android_ab.c +++ b/boot/android_ab.c @@ -139,8 +139,13 @@ static int ab_control_store(struct blk_desc *dev_desc, { ulong abc_offset, abc_blocks, ret; - abc_offset = offset + - offsetof(struct bootloader_message_ab, slot_suffix) / + if (offset % part_info->blksz) { + log_err("ANDROID: offset not block aligned\n"); + return -EINVAL; + } + + abc_offset = (offset + + offsetof(struct bootloader_message_ab, slot_suffix)) / part_info->blksz; abc_blocks = DIV_ROUND_UP(sizeof(struct bootloader_control), part_info->blksz); |