Skip to content

Commit 0b4db4a

Browse files
committed
Erase data if there's a validation error
1 parent b0acdc3 commit 0b4db4a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drv/cosmo-hf/src/apob.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,11 @@ impl ApobState {
646646
);
647647
*self = ApobState::Locked { commit_result: r };
648648
ringbuf_entry!(Trace::State(*self));
649+
650+
// If validation failed, then erase the just-written data and return the
651+
// error code (without updating the active slot).
649652
if r.is_err() {
650-
// XXX erase write slot here?
653+
Self::slot_erase(drv, write_slot);
651654
return r;
652655
}
653656

0 commit comments

Comments
 (0)