* [dpdk-dev] [PATCH v2] vfio: check ioctl return value
@ 2017-10-26 15:19 Jonas Pfefferle
2017-10-26 15:23 ` Burakov, Anatoly
0 siblings, 1 reply; 3+ messages in thread
From: Jonas Pfefferle @ 2017-10-26 15:19 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>
---
v2:
* fix whitespace/tab issue
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..f11f683 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] 3+ messages in thread
* Re: [dpdk-dev] [PATCH v2] vfio: check ioctl return value
2017-10-26 15:19 [dpdk-dev] [PATCH v2] vfio: check ioctl return value Jonas Pfefferle
@ 2017-10-26 15:23 ` Burakov, Anatoly
2017-10-26 21:52 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Burakov, Anatoly @ 2017-10-26 15:23 UTC (permalink / raw)
To: Jonas Pfefferle, dev
On 26-Oct-17 4:19 PM, Jonas Pfefferle wrote:
> 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>
> ---
> v2:
> * fix whitespace/tab issue
>
> 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..f11f683 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;
> }
>
Looks fine to me, so
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH v2] vfio: check ioctl return value
2017-10-26 15:23 ` Burakov, Anatoly
@ 2017-10-26 21:52 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2017-10-26 21:52 UTC (permalink / raw)
To: Jonas Pfefferle; +Cc: dev, Burakov, Anatoly
26/10/2017 17:23, Burakov, Anatoly:
> On 26-Oct-17 4:19 PM, Jonas Pfefferle wrote:
> > 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>
>
> Looks fine to me, so
>
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Applied, thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-26 21:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26 15:19 [dpdk-dev] [PATCH v2] vfio: check ioctl return value Jonas Pfefferle
2017-10-26 15:23 ` Burakov, Anatoly
2017-10-26 21:52 ` Thomas Monjalon
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).