From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 6A3FD1B119; Wed, 24 Oct 2018 12:24:34 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 03:24:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,420,1534834800"; d="scan'208";a="102025858" Received: from violet.igk.intel.com ([10.102.54.177]) by fmsmga001.fm.intel.com with ESMTP; 24 Oct 2018 03:24:31 -0700 From: Darek Stojaczyk To: dev@dpdk.org Cc: anatoly.burakov@intel.com, Darek Stojaczyk , jia.guo@intel.com, stable@dpdk.org Date: Wed, 24 Oct 2018 12:11:31 +0200 Message-Id: <20181024101131.17756-1-dariusz.stojaczyk@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] pci/vfio: fixup rte_intr_callback_unregister() handling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2018 10:24:35 -0000 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") Cc: jia.guo@intel.com Cc: stable@dpdk.org Signed-off-by: Darek Stojaczyk --- drivers/bus/pci/linux/pci_vfio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index b1f0683fe..305cc0601 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; -- 2.17.1