Skip to content

Commit

Permalink
Log hash driver init failure
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter committed Aug 23, 2024
1 parent 28006c7 commit 0a48496
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drv/cosmo-hf/src/hf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ impl idl::InOrderHostFlashImpl for ServerImpl {
len: u32,
) -> Result<[u8; SHA256_SZ], RequestError<HfError>> {
let hash_driver = drv_hash_api::Hash::from(HASH.get_task_id());
if hash_driver.init_sha256().is_err() {
if let Err(e) = hash_driver.init_sha256() {
ringbuf_entry!(Trace::HashInitError(e));
return Err(HfError::HashError.into());
}
let begin = addr as usize;
Expand Down
1 change: 1 addition & 0 deletions drv/cosmo-hf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ enum Trace {
SectorEraseBusy,
WriteBusy,

HashInitError(drv_hash_api::HashError),
HashUpdateError(drv_hash_api::HashError),
HashFinalizeError(drv_hash_api::HashError),
}
Expand Down

0 comments on commit 0a48496

Please sign in to comment.