From cb18edb53562021241eca7f93093e7960d89768c Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Fri, 5 Aug 2022 12:46:14 +0000 Subject: [PATCH] arch: return the correct size for SMBIOS occupied space The original value didn't include the size of the entry point structure. The caused the last entry to be corrupted by other code. Signed-off-by: Wei Liu --- arch/src/x86_64/smbios.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/src/x86_64/smbios.rs b/arch/src/x86_64/smbios.rs index 3104658ec..790036af2 100644 --- a/arch/src/x86_64/smbios.rs +++ b/arch/src/x86_64/smbios.rs @@ -250,7 +250,7 @@ pub fn setup_smbios( .map_err(|_| Error::WriteSmbiosEp)?; } - Ok(curptr.unchecked_offset_from(physptr)) + Ok(curptr.unchecked_offset_from(physptr) + std::mem::size_of::() as u64) } #[cfg(test)]