From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Jonas Pfefferle <jpf@zurich.ibm.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] vfio: check ioctl return value
Date: Thu, 26 Oct 2017 16:23:11 +0100 [thread overview]
Message-ID: <4a4cc895-0c87-da56-83e9-f5f5b1b623fa@intel.com> (raw)
In-Reply-To: <1509031189-22601-1-git-send-email-jpf@zurich.ibm.com>
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
next prev parent reply other threads:[~2017-10-26 15:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-26 15:19 Jonas Pfefferle
2017-10-26 15:23 ` Burakov, Anatoly [this message]
2017-10-26 21:52 ` Thomas Monjalon
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=4a4cc895-0c87-da56-83e9-f5f5b1b623fa@intel.com \
--to=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=jpf@zurich.ibm.com \
/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 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).