diff --git a/crosvm_plugin/src/lib.rs b/crosvm_plugin/src/lib.rs index 53a8569ad8..eb30e4b47d 100644 --- a/crosvm_plugin/src/lib.rs +++ b/crosvm_plugin/src/lib.rs @@ -1478,7 +1478,7 @@ pub unsafe extern "C" fn crosvm_set_hypercall_hint( hint.address_flags == CROSVM_HINT_ON_WRITE, slice::from_raw_parts(hint.details, hint.details_count as usize), ); - return to_crosvm_rc(ret); + to_crosvm_rc(ret) } #[no_mangle] diff --git a/devices/src/ioapic.rs b/devices/src/ioapic.rs index ce9f2b27a3..5f8270c214 100644 --- a/devices/src/ioapic.rs +++ b/devices/src/ioapic.rs @@ -142,7 +142,6 @@ impl BusDevice for Ioapic { } _ => { warn!("IOAPIC: Bad write to offset {}", offset); - return; } } } diff --git a/devices/src/usb/xhci/xhci_controller.rs b/devices/src/usb/xhci/xhci_controller.rs index 78022d3c6a..5db31ef68f 100644 --- a/devices/src/usb/xhci/xhci_controller.rs +++ b/devices/src/usb/xhci/xhci_controller.rs @@ -158,7 +158,6 @@ impl XhciController { } _ => { error!("xhci controller is in a wrong state"); - return; } } } @@ -201,7 +200,6 @@ impl PciDevice for XhciController { } _ => { error!("xhci controller is in a wrong state"); - return; } } } @@ -254,7 +252,6 @@ impl PciDevice for XhciController { } _ => { error!("xhci controller is in a wrong state"); - return; } } } @@ -274,10 +271,10 @@ impl PciDevice for XhciController { } _ => { error!("xhci controller is in a wrong state"); - return; } } } + fn on_device_sandboxed(&mut self) { self.init_when_forked(); } diff --git a/devices/src/virtio/balloon.rs b/devices/src/virtio/balloon.rs index eef70fb540..c93d60bdd5 100644 --- a/devices/src/virtio/balloon.rs +++ b/devices/src/virtio/balloon.rs @@ -364,7 +364,6 @@ impl VirtioDevice for Balloon { match worker_result { Err(e) => { error!("failed to spawn virtio_balloon worker: {}", e); - return; } Ok(join_handle) => { self.worker_thread = Some(join_handle); diff --git a/devices/src/virtio/input/mod.rs b/devices/src/virtio/input/mod.rs index a4561e5fe0..664f12123f 100644 --- a/devices/src/virtio/input/mod.rs +++ b/devices/src/virtio/input/mod.rs @@ -656,7 +656,6 @@ where match worker_result { Err(e) => { error!("failed to spawn virtio_input worker: {}", e); - return; } Ok(join_handle) => { self.worker_thread = Some(join_handle); @@ -664,7 +663,6 @@ where } } else { error!("tried to activate device without a source for events"); - return; } } } diff --git a/devices/src/virtio/tpm.rs b/devices/src/virtio/tpm.rs index 22d39a2028..abad4e29bf 100644 --- a/devices/src/virtio/tpm.rs +++ b/devices/src/virtio/tpm.rs @@ -257,7 +257,6 @@ impl VirtioDevice for Tpm { match worker_result { Err(e) => { error!("vtpm failed to spawn virtio_tpm worker: {}", e); - return; } Ok(join_handle) => { self.worker_thread = Some(join_handle); diff --git a/qcow/src/qcow.rs b/qcow/src/qcow.rs index 19ed922850..34a54f006a 100644 --- a/qcow/src/qcow.rs +++ b/qcow/src/qcow.rs @@ -1060,10 +1060,10 @@ impl QcowFile { let max_valid_cluster_offset = self.refcounts.max_valid_cluster_offset(); if let Some(new_cluster) = self.raw_file.add_cluster_end(max_valid_cluster_offset)? { - return Ok(new_cluster); + Ok(new_cluster) } else { error!("No free clusters in get_new_cluster()"); - return Err(std::io::Error::from_raw_os_error(ENOSPC)); + Err(std::io::Error::from_raw_os_error(ENOSPC)) } }