From: Jonas Pfefferle Date: Thu, 26 Oct 2017 15:19:49 +0000 (+0200) Subject: bus/pci: check VFIO reset ioctl error X-Git-Tag: spdx-start~1052 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f25f8f367644;p=dpdk.git bus/pci: check VFIO reset ioctl error Check return value of device reset ioctl Coverity issue: 195003 Fixes: 33604c31354a ("vfio: refactor PCI BAR mapping") Signed-off-by: Jonas Pfefferle Acked-by: Anatoly Burakov --- diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index 1a3c308e7c..360eed3800 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -339,7 +339,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; }