> From: Thomas Gleixner <tglx@xxxxxxxxxxxxx> > Sent: Thursday, November 24, 2022 5:09 PM > >> +void pci_msix_free_irq(struct pci_dev *dev, struct msi_map map) > >> +{ > >> + if (WARN_ON_ONCE(map.index < 0 || map.virq <= 0)) > > > > map.virq cannot be negative. > > Why? Callers can make up whatever they want, no? > obviously callers can. Read too fast... Then following check should be fixed too: +void pci_ims_free_irq(struct pci_dev *dev, struct msi_map map) +{ + if (WARN_ON_ONCE(map.index < 0 || !map.virq)) + return; + msi_domain_free_irqs_range(&dev->dev, MSI_SECONDARY_DOMAIN, map.index, map.index); +}