All of lore.kernel.org
 help / color / mirror / Atom feed
From: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
To: dev@dpdk.org
Cc: anatoly.burakov@intel.com,
	Darek Stojaczyk <dariusz.stojaczyk@intel.com>,
	jia.guo@intel.com, stable@dpdk.org
Subject: [PATCH] pci/vfio: fixup rte_intr_callback_unregister() handling
Date: Wed, 24 Oct 2018 12:11:31 +0200	[thread overview]
Message-ID: <20181024101131.17756-1-dariusz.stojaczyk@intel.com> (raw)

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 <dariusz.stojaczyk@intel.com>
---
 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

             reply	other threads:[~2018-10-24 10:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24 10:11 Darek Stojaczyk [this message]
2018-10-26 14:23 ` [PATCH] pci/vfio: fixup rte_intr_callback_unregister() handling Burakov, Anatoly
2018-10-29  0:10   ` Thomas Monjalon
2018-11-20 11:04 ` Kevin Traynor
2018-11-20 11:05   ` Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181024101131.17756-1-dariusz.stojaczyk@intel.com \
    --to=dariusz.stojaczyk@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=jia.guo@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.