mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
tpm: get_buffer_size always succeeds
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
2b76e1d7ba
commit
60425471dd
@ -259,7 +259,7 @@ impl Tpm {
|
||||
}
|
||||
|
||||
fn reset(&mut self) -> Result<()> {
|
||||
let cur_buff_size = self.emulator.get_buffer_size().unwrap();
|
||||
let cur_buff_size = self.emulator.get_buffer_size();
|
||||
self.regs = [0; TPM_CRB_R_MAX];
|
||||
set_reg_field(
|
||||
&mut self.regs,
|
||||
|
@ -454,12 +454,12 @@ impl Emulator {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get_buffer_size(&mut self) -> Result<usize> {
|
||||
pub fn get_buffer_size(&mut self) -> usize {
|
||||
let mut curr_buf_size: usize = 0;
|
||||
|
||||
match self.set_buffer_size(0, &mut curr_buf_size) {
|
||||
Err(_) => Ok(TPM_CRB_BUFFER_MAX),
|
||||
_ => Ok(curr_buf_size),
|
||||
Err(_) => TPM_CRB_BUFFER_MAX,
|
||||
_ => curr_buf_size,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user