We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ebf36e commit f7e8314Copy full SHA for f7e8314
drv/cosmo-hf/src/apob.rs
@@ -614,14 +614,12 @@ impl ApobState {
614
// Read data from the lease into local storage
615
let n = (data.len() - i).min(PAGE_SIZE_BYTES);
616
let addr = read_slot
617
- .flash_addr(i.try_into().unwrap_lite())
+ .flash_addr(u32::try_from(i as u64 + offset).unwrap_lite())
618
.unwrap_lite();
619
620
- // Read back the current data; it must be erased or match (for
621
- // idempotency)
+ // Read back the current data, then write it to the lease
622
drv.flash_read(addr, &mut &mut out_buf[..n])
623
.map_err(|_| ApobReadError::ReadFailed)?;
624
-
625
data.write_range(i..(i + n), &out_buf[..n])
626
627
}
0 commit comments