bus/pci: check VFIO reset ioctl error

Check return value of device reset ioctl

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

Signed-off-by: Jonas Pfefferle <jpf@zurich.ibm.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
This commit is contained in:
Jonas Pfefferle 2017-10-26 17:19:49 +02:00 committed by Thomas Monjalon
parent 633e4c7d71
commit f25f8f3676

View File

@ -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;
}