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 E95CB1B3B7 for ; Mon, 16 Oct 2017 10:32:28 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2017 01:32:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,386,1503385200"; d="scan'208";a="146910705" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 16 Oct 2017 01:32:27 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 16 Oct 2017 01:32:26 -0700 Received: from hasmsx105.ger.corp.intel.com (10.184.198.19) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 16 Oct 2017 01:32:26 -0700 Received: from hasmsx106.ger.corp.intel.com ([169.254.10.144]) by HASMSX105.ger.corp.intel.com ([169.254.1.195]) with mapi id 14.03.0319.002; Mon, 16 Oct 2017 11:32:23 +0300 From: "Basierski, SebastianX" To: "Tan, Jianfeng" , "'skhare@vmware.com'" CC: "'dev@dpdk.org'" , "Jain, Deepak K" Thread-Topic: [PATCH] pmd_virtio: Unchecked return value from library Thread-Index: AQHTMT1QpKF8YsDzj0KGnEBhaGBY8qK8wb+AgA7JGBCAGqc0YA== Date: Mon, 16 Oct 2017 08:32:23 +0000 Message-ID: <3A7E81AC661B4646A4CE6F2E09B7B74E4BBC3F@HASMSX106.ger.corp.intel.com> References: <1505821646-33594-1-git-send-email-sebastianx.basierski@intel.com> <3A7E81AC661B4646A4CE6F2E09B7B74E4BAA2B@HASMSX106.ger.corp.intel.com> In-Reply-To: <3A7E81AC661B4646A4CE6F2E09B7B74E4BAA2B@HASMSX106.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.103.103.98] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] pmd_virtio: Unchecked return value from library 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: Mon, 16 Oct 2017 08:32:29 -0000 -----Original Message----- From: Basierski, SebastianX=20 Sent: Friday, September 29, 2017 9:44 AM To: Tan, Jianfeng ; skhare@vmware.com Cc: dev@dpdk.org Subject: RE: [PATCH] pmd_virtio: Unchecked return value from library -----Original Message----- From: Tan, Jianfeng Sent: Wednesday, September 20, 2017 2:56 AM To: Basierski, SebastianX ; skhare@vmware.c= om Cc: dev@dpdk.org Subject: RE: [PATCH] pmd_virtio: Unchecked return value from library Hi, Thank you for those fixes. > -----Original Message----- > From: Basierski, SebastianX > Sent: Tuesday, September 19, 2017 7:47 PM > To: skhare@vmware.com > Cc: Basierski, SebastianX; Tan, Jianfeng; dev@dpdk.org > Subject: [PATCH] pmd_virtio: Unchecked return value from library >=20 > Check return value from library in order to prevent potential fail. >=20 > Coverity issue: 143439 >=20 > Fixes: ef53b6030039 ("net/virtio-user: support LSC") > Cc: jianfeng.tan@intel.com > cc: dev@dpdk.org >=20 > Signed-off-by: SebastianX Basierski > --- > drivers/net/virtio/virtio_user_ethdev.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/virtio/virtio_user_ethdev.c > b/drivers/net/virtio/virtio_user_ethdev.c > index c961444..16aa350 100644 > --- a/drivers/net/virtio/virtio_user_ethdev.c > +++ b/drivers/net/virtio/virtio_user_ethdev.c > @@ -86,7 +86,10 @@ virtio_user_read_dev_config(struct virtio_hw *hw,=20 > size_t offset, > int flags; >=20 > flags =3D fcntl(dev->vhostfd, F_GETFL); > - fcntl(dev->vhostfd, F_SETFL, flags | O_NONBLOCK); > + if (fcntl(dev->vhostfd, F_SETFL, > + flags | O_NONBLOCK) =3D=3D -1) > + return; Actually, even it fails, I still prefer to continue instead of "return" her= e. Maybe, we can report an error message here. Thanks, Jianfeng Hi Jianfeng, I'like to continue with the task. So please let me know if You are certain with Your option: continue instead of return (and add error report), despite possibility of r= eturning error from fcntl. Regards, Sebastian Basierski Hi, I understand You may be busy, but I really have to finish my task. Please let me know, what is Your decision about patch. Regards, Sebastian Basierski