otg: Allow exact out buffer size

The existing check required N+1 buffer size.
This commit is contained in:
Matt Johnston 2025-02-17 13:38:31 +08:00
parent 897d42e012
commit 5d6877cbc6

View File

@ -357,7 +357,7 @@ impl<'d, const MAX_EP_COUNT: usize> Driver<'d, MAX_EP_COUNT> {
);
if D::dir() == Direction::Out {
if self.ep_out_buffer_offset + max_packet_size as usize >= self.ep_out_buffer.len() {
if self.ep_out_buffer_offset + max_packet_size as usize > self.ep_out_buffer.len() {
error!("Not enough endpoint out buffer capacity");
return Err(EndpointAllocError);
}