Merge pull request #3226 from embassy-rs/otg-bounds-checks
usb-synopsys-otg: ensure ep alloc fails when endpoint_count < MAX_EP_COUNT.
This commit is contained in:
commit
03b8e36532
1 changed files with 2 additions and 2 deletions
|
@ -382,8 +382,8 @@ impl<'d, const MAX_EP_COUNT: usize> Driver<'d, MAX_EP_COUNT> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let eps = match D::dir() {
|
let eps = match D::dir() {
|
||||||
Direction::Out => &mut self.ep_out,
|
Direction::Out => &mut self.ep_out[..self.instance.endpoint_count],
|
||||||
Direction::In => &mut self.ep_in,
|
Direction::In => &mut self.ep_in[..self.instance.endpoint_count],
|
||||||
};
|
};
|
||||||
|
|
||||||
// Find free endpoint slot
|
// Find free endpoint slot
|
||||||
|
|
Loading…
Add table
Reference in a new issue