RE: [patch V2 25/33] PCI/MSI: Provide post-enable dynamic allocation interfaces for MSI-X

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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);
+}




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux