From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id DA6AB1BB36 for ; Thu, 26 Oct 2017 17:23:19 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Oct 2017 08:23:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,299,1505804400"; d="scan'208";a="328082616" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.237.210.134]) ([10.237.210.134]) by fmsmga004.fm.intel.com with ESMTP; 26 Oct 2017 08:23:11 -0700 To: Jonas Pfefferle , dev@dpdk.org References: <1509031189-22601-1-git-send-email-jpf@zurich.ibm.com> From: "Burakov, Anatoly" Message-ID: <4a4cc895-0c87-da56-83e9-f5f5b1b623fa@intel.com> Date: Thu, 26 Oct 2017 16:23:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1509031189-22601-1-git-send-email-jpf@zurich.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] vfio: check ioctl return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Oct 2017 15:23:21 -0000 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 > --- > 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 -- Thanks, Anatoly