We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0e904b3 + d365524 commit 85b8266Copy full SHA for 85b8266
1 file changed
src/drivers/virtio/transport/pci.rs
@@ -123,8 +123,9 @@ impl PciCap {
123
return None;
124
}
125
126
- // Drivers MAY do this check. See Virtio specification v1.1. - 4.1.4.1
127
- if self.len() < u64::try_from(mem::size_of::<CommonCfg>()).unwrap() {
+ // `CommonCfg::queue_notify_data` and `CommonCfg::queue_reset` are optional.
+ const MIN_SIZE: usize = mem::size_of::<CommonCfg>() - mem::size_of::<[le16; 2]>();
128
+ if self.len() < u64::try_from(MIN_SIZE).unwrap() {
129
error!(
130
"Common config of with id {}, does not represent actual structure specified by the standard!",
131
self.cap.id
0 commit comments