Skip to content

Commit 6c9198c

Browse files
committed
fix(vmm): simplify vcpus_handles dereferencing in process_uffd_socket
Get rid of the expect by using indexing. Signed-off-by: Nikita Kalyazin <[email protected]>
1 parent 0b1085b commit 6c9198c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/vmm/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -866,11 +866,7 @@ impl Vmm {
866866
match result {
867867
Ok(fault_reply) => {
868868
let vcpu = fault_reply.vcpu.expect("vCPU must be set");
869-
870-
self.vcpus_handles
871-
.get(vcpu as usize)
872-
.expect("Invalid vcpu index")
873-
.send_userfault_resolved();
869+
self.vcpus_handles[vcpu as usize].send_userfault_resolved();
874870

875871
total_consumed = parser.byte_offset();
876872
}

0 commit comments

Comments
 (0)