Skip to content

Commit 0649347

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 <kalyazin@amazon.com>
1 parent 5c9d93e commit 0649347

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
@@ -756,11 +756,7 @@ impl Vmm {
756756
match result {
757757
Ok(fault_reply) => {
758758
let vcpu = fault_reply.vcpu.expect("vCPU must be set");
759-
760-
self.vcpus_handles
761-
.get(vcpu as usize)
762-
.expect("Invalid vcpu index")
763-
.send_userfault_resolved();
759+
self.vcpus_handles[vcpu as usize].send_userfault_resolved();
764760

765761
total_consumed = parser.byte_offset();
766762
}

0 commit comments

Comments
 (0)