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 DC111DE0 for ; Wed, 20 Sep 2017 02:56:17 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2017 17:56:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,419,1500966000"; d="scan'208";a="902037958" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by FMSMGA003.fm.intel.com with ESMTP; 19 Sep 2017 17:56:16 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 19 Sep 2017 17:56:16 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 19 Sep 2017 17:56:16 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Wed, 20 Sep 2017 08:56:15 +0800 From: "Tan, Jianfeng" To: "Basierski, SebastianX" , "skhare@vmware.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH] pmd_virtio: Unchecked return value from library Thread-Index: AQHTMT1QxNG4OaRuZUCnNZdpCsZe46K882xw Date: Wed, 20 Sep 2017 00:56:15 +0000 Message-ID: References: <1505821646-33594-1-git-send-email-sebastianx.basierski@intel.com> In-Reply-To: <1505821646-33594-1-git-send-email-sebastianx.basierski@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] 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: Wed, 20 Sep 2017 00:56:18 -0000 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, > 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