From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 68808AFCF for ; Thu, 19 Jun 2014 17:46:39 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 19 Jun 2014 08:46:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,507,1400050800"; d="scan'208";a="550448457" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga001.fm.intel.com with ESMTP; 19 Jun 2014 08:46:22 -0700 Received: from irsmsx108.ger.corp.intel.com (163.33.3.3) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 19 Jun 2014 16:46:21 +0100 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.245]) by IRSMSX108.ger.corp.intel.com ([169.254.11.221]) with mapi id 14.03.0123.003; Thu, 19 Jun 2014 16:46:21 +0100 From: "Burakov, Anatoly" To: Aaron Campbell , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] eal: clear errno before calling strtoull() to parse base_virtaddr Thread-Index: AQHPi9U7DUgkeua4NEKypMhafrhu0pt4k1rA Date: Thu, 19 Jun 2014 15:46:21 +0000 Message-ID: References: <1403192557-10905-1-git-send-email-aaron@arbor.net> In-Reply-To: <1403192557-10905-1-git-send-email-aaron@arbor.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] eal: clear errno before calling strtoull() to parse base_virtaddr 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: Thu, 19 Jun 2014 15:46:39 -0000 Hi Aaron, It seems that Pablo De Lara has beat you to it by a few minutes :-) Are the= re any other places this could potentially happen? > Must reset errno to zero before calling strtoull(), else on success it co= uld be > any arbitrary value from past errors. >=20 > Signed-off-by: Aaron Campbell > --- > lib/librte_eal/linuxapp/eal/eal.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/= eal/eal.c > index 6994303..d204387 100644 > --- a/lib/librte_eal/linuxapp/eal/eal.c > +++ b/lib/librte_eal/linuxapp/eal/eal.c > @@ -562,6 +562,7 @@ eal_parse_base_virtaddr(const char *arg) > char *end; > uint64_t addr; >=20 > + errno =3D 0; > addr =3D strtoull(arg, &end, 16); >=20 > /* check for errors */ > -- > 1.8.3.2