summaryrefslogtreecommitdiff
path: root/drivers/bus/pci
diff options
context:
space:
mode:
authorDarek Stojaczyk <dariusz.stojaczyk@intel.com>2018-10-24 12:11:31 +0200
committerThomas Monjalon <thomas@monjalon.net>2018-10-29 01:59:48 +0100
commitd59ba0296e886adb38ede9505ea7508e62df304d (patch)
tree4d6539bffbd9ccd833cbc75273d2d8d79de388ee /drivers/bus/pci
parent6bcb7c95fe14544bca9de1a698e4553533192197 (diff)
downloaddpdk-d59ba0296e886adb38ede9505ea7508e62df304d.zip
dpdk-d59ba0296e886adb38ede9505ea7508e62df304d.tar.gz
dpdk-d59ba0296e886adb38ede9505ea7508e62df304d.tar.xz
vfio: fix interrupt unregister for hotplug notifier
This function is documented to return the number of unregistered callbacks or negative numbers on error, but pci_vfio checks for ret != 0 to detect failures. Not anymore. Fixes: c115fd000c32 ("vfio: handle hotplug request notifier") Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Diffstat (limited to 'drivers/bus/pci')
-rw-r--r--drivers/bus/pci/linux/pci_vfio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index b1f0683..305cc06 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -341,7 +341,7 @@ pci_vfio_enable_notifier(struct rte_pci_device *dev, int vfio_dev_fd)
ret = rte_intr_callback_unregister(&dev->vfio_req_intr_handle,
pci_vfio_req_handler,
(void *)&dev->device);
- if (ret)
+ if (ret < 0)
RTE_LOG(ERR, EAL,
"Fail to unregister req notifier handler.\n");
goto error;
@@ -373,7 +373,7 @@ pci_vfio_disable_notifier(struct rte_pci_device *dev)
ret = rte_intr_callback_unregister(&dev->vfio_req_intr_handle,
pci_vfio_req_handler,
(void *)&dev->device);
- if (ret) {
+ if (ret < 0) {
RTE_LOG(ERR, EAL,
"fail to unregister req notifier handler.\n");
return -1;