From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D47113572 for ; Wed, 7 Nov 2018 11:03:20 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Nov 2018 02:03:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,475,1534834800"; d="scan'208";a="89232469" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 07 Nov 2018 02:03:19 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 7 Nov 2018 02:03:19 -0800 Received: from fmsmsx117.amr.corp.intel.com ([169.254.3.70]) by fmsmsx120.amr.corp.intel.com ([169.254.15.78]) with mapi id 14.03.0415.000; Wed, 7 Nov 2018 02:03:19 -0800 From: "Wiles, Keith" To: Stephen Hemminger CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 4/4] net/tap: fix warning about comparison of fd Thread-Index: AQHUdgdNvNEIyHTVJ0qTJGL3J4BesaVEnEQA Date: Wed, 7 Nov 2018 10:03:18 +0000 Message-ID: <712EC9C3-4254-49B2-A815-0372FB374E9A@intel.com> References: <20181106193005.5383-1-stephen@networkplumber.org> <20181106193005.5383-5-stephen@networkplumber.org> In-Reply-To: <20181106193005.5383-5-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.237.220.99] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 4/4] net/tap: fix warning about comparison of fd 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, 07 Nov 2018 10:03:21 -0000 > On Nov 6, 2018, at 7:30 PM, Stephen Hemminger wrote: >=20 > Static analysis tools don't like the fact that fd could be zero > in the error path. This won't happen in real world because > stdin would have to be closed, then other error occurring. Acked-by: Keith Wiles >=20 > Coverity issue: 14079 > Fixes: 02f96a0a82d1 ("net/tap: add TUN/TAP device PMD") > Signed-off-by: Stephen Hemminger > --- > drivers/net/tap/rte_eth_tap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.= c > index 84aaf241019a..f7087222b319 100644 > --- a/drivers/net/tap/rte_eth_tap.c > +++ b/drivers/net/tap/rte_eth_tap.c > @@ -231,7 +231,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive= ) > return fd; >=20 > error: > - if (fd > 0) > + if (fd >=3D 0) > close(fd); > return -1; > } > --=20 > 2.17.1 >=20 Regards, Keith