Re: [RFC 1/4] bus/pci: fix check on interrupt FD for FreeBSD
David Marchand <[email protected]> Thu, 23 Jul 2026 15:54:21 +0200
| Newsgroups | org.dpdk.dev |
|---|---|
| Message-ID | <CAJFAV8wqcNPWffRmFLcUNcSL4KD3T0v5v-kjLX886BqFiV4XWQ@mail.gmail.com> |
On Thu, 23 Jul 2026 at 15:35, Bruce Richardson <[email protected]> wrote: > > On Thu, Jul 23, 2026 at 03:19:04PM +0200, David Marchand wrote: > > A 0 file descriptor is valid. And a negative value is not. > > Only close a positive file descriptor. > > > > Fixes: 5a60a7ffc801 ("pci: introduce functions to alloc and free uio resource") > > > > Signed-off-by: David Marchand <[email protected]> > > --- > > drivers/bus/pci/bsd/pci.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c > > index c6df31d486..bbe08605af 100644 > > --- a/drivers/bus/pci/bsd/pci.c > > +++ b/drivers/bus/pci/bsd/pci.c > > @@ -93,7 +93,7 @@ pci_uio_free_resource(struct rte_pci_device *dev, > > { > > rte_free(uio_res); > > > > - if (rte_intr_fd_get(dev->intr_handle)) { > > + if (rte_intr_fd_get(dev->intr_handle) >= 0) { > > close(rte_intr_fd_get(dev->intr_handle)); > > rte_intr_fd_set(dev->intr_handle, -1); > > rte_intr_type_set(dev->intr_handle, RTE_INTR_HANDLE_UNKNOWN); > > Unlikely that we actually have fd as 0 for this call, but change is > technically correct. Yes, this is why I did not Cc: stable. Thanks. -- David Marchand