From ccf9897101a566552220947e2742a0dba9354150 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Wed, 17 Jul 2024 12:06:07 -0400 Subject: [PATCH] boot: Always impl Drop for MemoryMapBackingMemory Gating this on `cfg(not(test))` isn't necessary; during unit tests `system_table_boot()` will return `None` and so the drop won't do anything anyway. Also fix a typo, excited -> exited. --- uefi/src/table/boot.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/uefi/src/table/boot.rs b/uefi/src/table/boot.rs index 778e51b3b..79c2c50ec 100644 --- a/uefi/src/table/boot.rs +++ b/uefi/src/table/boot.rs @@ -1737,8 +1737,6 @@ impl MemoryMapBackingMemory { } } -// Don't drop when we use this in unit tests. -#[cfg(not(test))] impl Drop for MemoryMapBackingMemory { fn drop(&mut self) { if let Some(bs) = system_table_boot() { @@ -1747,7 +1745,7 @@ impl Drop for MemoryMapBackingMemory { log::error!("Failed to deallocate memory map: {e:?}"); } } else { - log::debug!("Boot services are excited. Memory map won't be freed using the UEFI boot services allocator."); + log::debug!("Boot services are exited. Memory map won't be freed using the UEFI boot services allocator."); } } }