From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 9DF411B745; Tue, 24 Oct 2017 09:27:48 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 24 Oct 2017 00:27:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,426,1503385200"; d="scan'208";a="326918988" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 24 Oct 2017 00:27:44 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 24 Oct 2017 00:27:41 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 24 Oct 2017 00:27:40 -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; Tue, 24 Oct 2017 15:26:55 +0800 From: "Tan, Jianfeng" To: "Basierski, SebastianX" , "yliu@fridaylinux.org" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v2] Report an error message if the flag O_NONBLOCK setting fails, then return from function. Thread-Index: AQHTTIeYv19RVlCob0Ogj6g4wL68/KLymVLg Date: Tue, 24 Oct 2017 07:26:54 +0000 Message-ID: References: <1505821646-33594-1-git-send-email-sebastianx.basierski@intel.com> <1508821844-37372-1-git-send-email-sebastianx.basierski@intel.com> <1508821844-37372-2-git-send-email-sebastianx.basierski@intel.com> In-Reply-To: <1508821844-37372-2-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 v2] Report an error message if the flag O_NONBLOCK setting fails, then return from function. 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: Tue, 24 Oct 2017 07:27:49 -0000 > -----Original Message----- > From: Basierski, SebastianX > Sent: Tuesday, October 24, 2017 1:11 PM > To: yliu@fridaylinux.org > Cc: dev@dpdk.org; Basierski, SebastianX; Tan, Jianfeng; stable@dpdk.org > Subject: [PATCH v2] Report an error message if the flag O_NONBLOCK > setting fails, then return from function. >=20 > Coverity issue: 143439 >=20 > Fixes: ef53b6030039 ("net/virtio-user: support LSC") > Cc: jianfeng.tan@intel.com > cc: stable@dpdk.org >=20 > Signed-off-by: SebastianX Basierski Except a nit below, Acked-by: Jianfeng Tan > --- > drivers/net/virtio/virtio_user_ethdev.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/virtio/virtio_user_ethdev.c > b/drivers/net/virtio/virtio_user_ethdev.c > index 57c964d..fe3a7be 100644 > --- a/drivers/net/virtio/virtio_user_ethdev.c > +++ b/drivers/net/virtio/virtio_user_ethdev.c > @@ -86,7 +86,11 @@ 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){ There should be a space between ")" and "{". > + PMD_DRV_LOG(ERR, "error setting > O_NONBLOCK flag"); > + return; > + } > r =3D recv(dev->vhostfd, buf, 128, MSG_PEEK); > if (r =3D=3D 0 || (r < 0 && errno !=3D EAGAIN)) { > dev->status &=3D (~VIRTIO_NET_S_LINK_UP); > -- > 2.7.4