pci: fix UIO interrupt file descriptor check before close
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal_pci_uio.c
index 3e4ffb5..20a4a66 100644 (file)
@@ -230,7 +230,7 @@ pci_uio_free_resource(struct rte_pci_device *dev,
                close(dev->intr_handle.uio_cfg_fd);
                dev->intr_handle.uio_cfg_fd = -1;
        }
-       if (dev->intr_handle.fd) {
+       if (dev->intr_handle.fd >= 0) {
                close(dev->intr_handle.fd);
                dev->intr_handle.fd = -1;
                dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;