Skip to content

Commit 2a7c1c8

Browse files
committed
Updated lib.rs to prevent calling devirtualize 2 times
hv.devirtualize() and core::mem::drop(hv) are doing the same thing in a different way. This could lead to BSOD/undefined behavior.
1 parent f5971d8 commit 2a7c1c8

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

driver/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ static mut HYPERVISOR: Option<Hypervisor> = None;
4747

4848
pub extern "system" fn driver_unload(_driver: &mut DRIVER_OBJECT) {
4949
if let Some(mut hv) = unsafe { HYPERVISOR.take() } {
50-
hv.devirtualize();
51-
5250
core::mem::drop(hv);
5351
}
5452
}

0 commit comments

Comments
 (0)