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 9F4781B684; Fri, 13 Oct 2017 13:57:03 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Oct 2017 04:57:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,370,1503385200"; d="scan'208";a="1181597364" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by orsmga001.jf.intel.com with ESMTP; 13 Oct 2017 04:57:01 -0700 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by IRSMSX104.ger.corp.intel.com (163.33.3.159) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 13 Oct 2017 12:56:24 +0100 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.28]) by irsmsx111.ger.corp.intel.com ([169.254.2.30]) with mapi id 14.03.0319.002; Fri, 13 Oct 2017 12:56:24 +0100 From: "Jastrzebski, MichalX K" To: "Piasecki, JacekX" , "dev@dpdk.org" CC: "Richardson, Bruce" , "Van Haaren, Harry" , "Mcnamara, John" , "Piasecki, JacekX" , "ian.betts@intel.com" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] examples/performance-thread: fix return check Thread-Index: AQHTQ1BpuP+juZLb2E6jn0Uo3cJQ0aLhrU6Q Date: Fri, 13 Oct 2017 11:56:23 +0000 Message-ID: <60ABE07DBB3A454EB7FAD707B4BB158213C4693B@IRSMSX109.ger.corp.intel.com> References: <1507808684-37821-1-git-send-email-jacekx.piasecki@intel.com> In-Reply-To: <1507808684-37821-1-git-send-email-jacekx.piasecki@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTY1YjIzOTgtMWM4Zi00Y2VhLThmMWQtNmI3OWFiZTgxODE5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjNwbkZ5WDlUNWF3UCt6bjRpYWt0WlhUVURBZmY2ODBmTVh4dGFUUGZ1Yzg9In0= 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] examples/performance-thread: fix return check 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: Fri, 13 Oct 2017 11:57:04 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jacek Piasecki > Sent: Thursday, October 12, 2017 1:45 PM > To: dev@dpdk.org > Cc: Richardson, Bruce ; Van Haaren, Harry > ; Mcnamara, John > ; Piasecki, JacekX > ; ian.betts@intel.com; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] examples/performance-thread: fix return check >=20 > There was a call for thread create function without result check. > Added result check and message printout after failure. >=20 > Coverity issue: 143441 > Fixes: 433ba6228f9a ("examples/performance-thread: add pthread_shim > app") > Cc: ian.betts@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Jacek Piasecki > --- > examples/performance-thread/pthread_shim/main.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/examples/performance-thread/pthread_shim/main.c > b/examples/performance-thread/pthread_shim/main.c > index 850b009..febae39 100644 > --- a/examples/performance-thread/pthread_shim/main.c > +++ b/examples/performance-thread/pthread_shim/main.c > @@ -161,6 +161,7 @@ static void initial_lthread(void *args > __attribute__((unused))) > pthread_override_set(1); >=20 > uint64_t i; > + int ret; >=20 > /* initialize mutex for shared counter */ > print_count =3D 0; > @@ -187,7 +188,10 @@ static void initial_lthread(void *args > __attribute__((unused))) > pthread_attr_setaffinity_np(&attr, sizeof(rte_cpuset_t), > &cpuset); >=20 > /* create the thread */ > - pthread_create(&tid[i], &attr, helloworld_pthread, (void *) > i); > + ret =3D pthread_create(&tid[i], &attr, > + helloworld_pthread, (void *) i); > + if (ret !=3D 0) > + rte_exit(EXIT_FAILURE, "Cannot create helloworld > thread\n"); > } >=20 > /* wait for 1s to allow threads > -- > 1.9.1 Acked-by: Michal Jastrzebski