diff --git a/uefi/src/proto/ata/pass_thru.rs b/uefi/src/proto/ata/pass_thru.rs index 3b7a277c5..d50d21843 100644 --- a/uefi/src/proto/ata/pass_thru.rs +++ b/uefi/src/proto/ata/pass_thru.rs @@ -42,7 +42,9 @@ impl AtaPassThru { /// The [`AtaPassThruMode`] structure containing configuration details of the protocol. #[must_use] pub fn mode(&self) -> AtaPassThruMode { - unsafe { (*self.0.mode).clone() } + let mut mode = unsafe { (*self.0.mode).clone() }; + mode.io_align = mode.io_align.max(1); // 0 and 1 is the same, says UEFI spec + mode } /// Retrieves the I/O buffer alignment required by this SCSI channel. diff --git a/uefi/src/proto/nvme/pass_thru.rs b/uefi/src/proto/nvme/pass_thru.rs index ece5954e9..588845410 100644 --- a/uefi/src/proto/nvme/pass_thru.rs +++ b/uefi/src/proto/nvme/pass_thru.rs @@ -49,7 +49,9 @@ impl NvmePassThru { /// An instance of [`NvmePassThruMode`] describing the NVMe controller's capabilities. #[must_use] pub fn mode(&self) -> NvmePassThruMode { - unsafe { (*self.0.mode).clone() } + let mut mode = unsafe { (*self.0.mode).clone() }; + mode.io_align = mode.io_align.max(1); // 0 and 1 is the same, says UEFI spec + mode } /// Retrieves the alignment requirements for I/O buffers.