Skip to content

Commit ceef74b

Browse files
return InvalidMaxSize in Queue::new
This was previously returning a wrong Error variant. Signed-off-by: Andreea Florescu <[email protected]>
1 parent ce77c81 commit ceef74b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/virtio-queue/src/queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl QueueT for Queue {
280280
// We need to check that the max size is a power of 2 because we're setting this as the
281281
// queue size, and the valid queue sizes are a power of 2 as per the specification.
282282
if max_size == 0 || max_size > MAX_QUEUE_SIZE || (max_size & (max_size - 1)) != 0 {
283-
return Err(Error::AddressOverflow);
283+
return Err(Error::InvalidMaxSize);
284284
}
285285
Ok(Queue {
286286
max_size,

0 commit comments

Comments
 (0)