Skip to content

Commit e37f7c2

Browse files
committed
kvm_cpu: Minor unsafe code removal (ptr -> slice.fill)
1 parent 8fecc84 commit e37f7c2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/linux/x86_64/kvm_cpu.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,8 @@ impl VirtualCPU for KvmCpu {
444444
warn!("Guest tries to access non-present virtio device");
445445
}
446446
} else {
447-
unsafe { *(addr.as_ptr() as *mut u32) = 0xffffffff };
447+
warn!("Invalid pci config data port access");
448+
addr.fill(0xff);
448449
}
449450
}
450451
PCI_CONFIG_ADDRESS_PORT => {}

0 commit comments

Comments
 (0)