DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vfio: check ioctl return value
@ 2017-10-26 15:13 Jonas Pfefferle
  0 siblings, 0 replies; only message in thread
From: Jonas Pfefferle @ 2017-10-26 15:13 UTC (permalink / raw)
  To: dev; +Cc: anatoly.burakov, Jonas Pfefferle

Check return value of device reset ioctl

Fixes: 33604c31354a ("vfio: refactor PCI BAR mapping")
Coverity issue: 195003

Signed-off-by: Jonas Pfefferle <jpf@zurich.ibm.com>
---
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
index d407c87..d5f6637 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
@@ -333,7 +333,11 @@ pci_vfio_setup_device(struct rte_pci_device *dev, int vfio_dev_fd)
 	}
 
 	/* Reset the device */
-	ioctl(vfio_dev_fd, VFIO_DEVICE_RESET);
+	if (ioctl(vfio_dev_fd, VFIO_DEVICE_RESET)) {
+		RTE_LOG(ERR, EAL, "Unable to reset device! Error: %d (%s)\n",
+				errno, strerror(errno));
+		return -1;
+    }
 
 	return 0;
 }
-- 
2.7.4

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-26 15:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26 15:13 [dpdk-dev] [PATCH] vfio: check ioctl return value Jonas Pfefferle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).