From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 195FD8E72 for ; Fri, 11 Dec 2015 15:40:25 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 11 Dec 2015 06:40:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,414,1444719600"; d="scan'208";a="858835009" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga001.fm.intel.com with ESMTP; 11 Dec 2015 06:40:24 -0800 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.13]) by IRSMSX151.ger.corp.intel.com ([169.254.4.95]) with mapi id 14.03.0248.002; Fri, 11 Dec 2015 14:40:21 +0000 From: "Mcnamara, John" To: "Liang, Cunming" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v1] eal: fix negative value incorrectly being used defect Thread-Index: AQHRM7Yu/RCeUpkysUiyUyQZWtrEcJ7F2qaw Date: Fri, 11 Dec 2015 14:40:21 +0000 Message-ID: References: <1449798537-3221-1-git-send-email-cunming.liang@intel.com> In-Reply-To: <1449798537-3221-1-git-send-email-cunming.liang@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1] eal: fix negative value incorrectly being used defect X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 14:40:26 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Cunming Liang > Sent: Friday, December 11, 2015 1:49 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v1] eal: fix negative value incorrectly being > used defect >=20 > In eal_intr_proc_rxtx_intr, negative value may be used as argument to a > function expecting a positive value. If 'read' returns EAGAIN as example, > the bytes_read updates to a negative value which continue be passed as > argument for the next 'read'. >=20 > Coverity issue: 107115 >=20 > 927 do { > 3. negative_return_fn: Function read(fd, &buf, bytes_read) returns a > negative number. > 4. var_assign: Assigning: signed variable bytes_read =3D read. > CID 107115 (#1 of 1): Argument cannot be negative > (NEGATIVE_RETURNS)9. negative_returns: bytes_read is passed to a > parameter > that cannot be negative. > 928 bytes_read =3D read(fd, &buf, bytes_read); >=20 > Fixes: c9f3ec1a0f3f ("eal/linux: add Rx interrupt control function") >=20 > Signed-off-by: Cunming Liang Acked-by: John McNamara