Skip to content

Commit bf4c355

Browse files
slpandreeaflorescu
authored andcommitted
Do endianess conversion on QueueState::used_idx
QueueState::used_idx provides access to a field from the raw virtqueue, so it needs endianess conversion. Let's add it here. Signed-off-by: Sergio Lopez <slp@redhat.com>
1 parent ea8f3e2 commit bf4c355

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/virtio-queue/src/state.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ impl QueueStateT for QueueState {
318318
.ok_or(Error::AddressOverflow)?;
319319

320320
mem.load(addr, order)
321+
.map(u16::from_le)
321322
.map(Wrapping)
322323
.map_err(Error::GuestMemory)
323324
}

0 commit comments

Comments
 (0)