mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
IrqVectorRegistration::index() accepts a usize, but pci_irq_vector()
takes an unsigned int. On 64-bit architectures, casting an index larger
than u32::MAX wraps it before the PCI core can validate it. In
particular, u32::MAX + 1 becomes zero and can resolve to the first
allocated vector.
Use a checked conversion and return EINVAL when the index cannot be
represented by the C API.
Fixes:
|
||
|---|---|---|
| .. | ||
| id.rs | ||
| io.rs | ||
| irq.rs | ||