[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB52766BA9CE2BA102FA41297A8C139@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Mon, 28 Nov 2022 01:49:44 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>
CC: "x86@...nel.org" <x86@...nel.org>, Joerg Roedel <joro@...tes.org>,
"Will Deacon" <will@...nel.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"Lorenzo Pieralisi" <lorenzo.pieralisi@....com>,
Marc Zyngier <maz@...nel.org>,
"Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
Jason Gunthorpe <jgg@...lanox.com>,
"Jiang, Dave" <dave.jiang@...el.com>,
Alex Williamson <alex.williamson@...hat.com>,
"Williams, Dan J" <dan.j.williams@...el.com>,
Logan Gunthorpe <logang@...tatee.com>,
"Raj, Ashok" <ashok.raj@...el.com>, Jon Mason <jdmason@...zu.us>,
Allen Hubbe <allenbh@...il.com>
Subject: RE: [patch V2 25/33] PCI/MSI: Provide post-enable dynamic allocation
interfaces for MSI-X
> From: Thomas Gleixner <tglx@...utronix.de>
> 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);
+}
Powered by blists - more mailing lists