libflash/libffs: Correctly update the actual size of the partition
libffs has been updating FFS partition information in the wrong place
which leads to incomplete erases and corruption.
Fixes: libflash/libffs: Rework libffs
@@ -781,7 +781,7 @@ int ffs_update_act_size(struct ffs_handle *ffs, uint32_t part_idx,
FL_DBG("FFS: Entry not found\n");
return FFS_ERR_PART_NOT_FOUND;
}
- offset = ent->base;
+ offset = ffs->toc_offset + ffs_hdr_raw_size(part_idx);
FL_DBG("FFS: part index %d at offset 0x%08x\n",
part_idx, offset);
