From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id E7C04AFD3 for ; Wed, 16 Apr 2014 12:50:57 +0200 (CEST) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1WaNQb-0007gr-9o; Wed, 16 Apr 2014 06:50:56 -0400 From: Neil Horman To: dev@dpdk.org Date: Wed, 16 Apr 2014 06:50:40 -0400 Message-Id: <1397645440-14813-1-git-send-email-nhorman@tuxdriver.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: [dpdk-dev] [PATCH] eal: check error conditinos for every loop iteration 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: Wed, 16 Apr 2014 10:50:58 -0000 The return code for rte_cpu_get_flag_enabled is only checked on the termination of the for loop that it is called inside, but should be checked for every iteration it makes through the for loop. This is caused by some silly missing brackets. Simply add them in Signed-off-by: Neil Horman Reported-by: Pablo De Lara Guarch CC: Pablo De Lara Guarch CC: Thomas Monjalon --- lib/librte_eal/common/eal_common_cpuflags.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_cpuflags.c b/lib/librte_eal/common/eal_common_cpuflags.c index f9c1840..5c0927c 100644 --- a/lib/librte_eal/common/eal_common_cpuflags.c +++ b/lib/librte_eal/common/eal_common_cpuflags.c @@ -255,7 +255,7 @@ rte_cpu_check_supported(void) unsigned i; int ret; - for (i = 0; i < sizeof(compile_time_flags)/sizeof(compile_time_flags[0]); i++) + for (i = 0; i < sizeof(compile_time_flags)/sizeof(compile_time_flags[0]); i++) { ret = rte_cpu_get_flag_enabled(compile_time_flags[i]); if (ret < 0) { @@ -271,4 +271,5 @@ rte_cpu_check_supported(void) cpu_feature_table[compile_time_flags[i]].name); exit(1); } + } } -- 1.8.3.1