From patchwork Thu Oct 12 11:44:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Piasecki X-Patchwork-Id: 30251 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 71DE51B268; Thu, 12 Oct 2017 13:50:55 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5BEDC1B266; Thu, 12 Oct 2017 13:50:53 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2017 04:50:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.43,365,1503385200"; d="scan'208"; a="1181242800" Received: from gklab-246-073.igk.intel.com (HELO Sent) ([10.217.246.73]) by orsmga001.jf.intel.com with SMTP; 12 Oct 2017 04:50:46 -0700 Received: by Sent (sSMTP sendmail emulation); Thu, 12 Oct 2017 13:44:58 +0200 From: Jacek Piasecki To: dev@dpdk.org Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com, john.mcnamara@intel.com, Jacek Piasecki , ian.betts@intel.com, stable@dpdk.org Date: Thu, 12 Oct 2017 13:44:44 +0200 Message-Id: <1507808684-37821-1-git-send-email-jacekx.piasecki@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" There was a call for thread create function without result check. Added result check and message printout after failure. Coverity issue: 143441 Fixes: 433ba6228f9a ("examples/performance-thread: add pthread_shim app") Cc: ian.betts@intel.com Cc: stable@dpdk.org Signed-off-by: Jacek Piasecki Acked-by: Michal Jastrzebski --- examples/performance-thread/pthread_shim/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); uint64_t i; + int ret; /* initialize mutex for shared counter */ print_count = 0; @@ -187,7 +188,10 @@ static void initial_lthread(void *args __attribute__((unused))) pthread_attr_setaffinity_np(&attr, sizeof(rte_cpuset_t), &cpuset); /* create the thread */ - pthread_create(&tid[i], &attr, helloworld_pthread, (void *) i); + ret = pthread_create(&tid[i], &attr, + helloworld_pthread, (void *) i); + if (ret != 0) + rte_exit(EXIT_FAILURE, "Cannot create helloworld thread\n"); } /* wait for 1s to allow threads