kvm: fix a couple of typos in comments

BUG=None
TEST=cargo test --features plugin; cargo test -p kvm

Change-Id: If3408984ebb4f9212aaaae6084353a411a7f902b
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/938845
Reviewed-by: Zach Reizner <zachr@chromium.org>
This commit is contained in:
Dmitry Torokhov 2018-02-26 09:46:32 -08:00 committed by chrome-bot
parent 9786573e07
commit 9c7508593d

View file

@ -863,11 +863,11 @@ impl Vcpu {
let vec: Vec<u8> = vec![0; vec_size_bytes];
let msrs: &mut kvm_msrs = unsafe {
// Converting the vector's memory to a struct is unsafe. Carefully using the read-only
// vector to size and set the members ensures no out-of-bounds erros below.
// vector to size and set the members ensures no out-of-bounds errors below.
&mut *(vec.as_ptr() as *mut kvm_msrs)
};
unsafe {
// Mapping the unsized array to a slice is unsafe becase the length isn't known.
// Mapping the unsized array to a slice is unsafe because the length isn't known.
// Providing the length used to create the struct guarantees the entire slice is valid.
let entries: &mut [kvm_msr_entry] = msrs.entries.as_mut_slice(msr_entries.len());
entries.copy_from_slice(&msr_entries);