From patchwork Fri Oct 24 19:36:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 39495 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6AA2C20341 for ; Fri, 24 Oct 2014 19:37:25 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id gi9sf2204517lab.2 for ; Fri, 24 Oct 2014 12:37:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=eu3huv00LGvNYNrwO9uymvMm5fvb53naj6upDBnWz38=; b=V9b/PKozcHjTg1Rf8NdY0CZSsatZgMOHEgwvXaNu4keb5QxwewU0FSBrVhvYHV6GEY Frrjs62sdpSTknACgc1289cQa0oE/KXTyunbEkgjHjoV4xHVVx6a6WVX1FHAz9+cVNd5 riCwyhKoc92LpXs/QzJ5uh4dOAcmx1k+B18CY4l1KuNWkAoxpByZcgt5D3hiyHQxcZg7 IrY8XuR8/R0646Sk7UcqvcZzHKSwBV2+7nvyikSPyl8RGHVOf+6MYpk21tPLbBEAqCf6 PDIDl00ZOqo6RW3v2c0oN8uZJCOmS/aw+JX6ZmniV8Mrof7DjLRv0AMVrWjMEEXeq8qK 7oWg== X-Gm-Message-State: ALoCoQmD3tVe8V4yEKtRc956M4J4Nb2VYWWDzCgmHCRkfZhBrm43OyC/SpSXI2ViEJsramQOl6SB X-Received: by 10.152.1.133 with SMTP id 5mr4137lam.8.1414179443500; Fri, 24 Oct 2014 12:37:23 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.207.4 with SMTP id ls4ls426712lac.37.gmail; Fri, 24 Oct 2014 12:37:22 -0700 (PDT) X-Received: by 10.153.5.33 with SMTP id cj1mr6698371lad.36.1414179442478; Fri, 24 Oct 2014 12:37:22 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id v9si7563156lag.69.2014.10.24.12.37.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Oct 2014 12:37:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id gf13so1874278lab.8 for ; Fri, 24 Oct 2014 12:37:22 -0700 (PDT) X-Received: by 10.152.116.102 with SMTP id jv6mr6661198lab.40.1414179442002; Fri, 24 Oct 2014 12:37:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp492710lbz; Fri, 24 Oct 2014 12:37:21 -0700 (PDT) X-Received: by 10.229.83.134 with SMTP id f6mr9269632qcl.22.1414179440647; Fri, 24 Oct 2014 12:37:20 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id c5si9349524qge.114.2014.10.24.12.37.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 24 Oct 2014 12:37:20 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xhkfm-0004l7-6D; Fri, 24 Oct 2014 19:37:18 +0000 Received: from mail-qc0-f169.google.com ([209.85.216.169]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Xhkff-0004jo-JR for lng-odp@lists.linaro.org; Fri, 24 Oct 2014 19:37:11 +0000 Received: by mail-qc0-f169.google.com with SMTP id o8so1300401qcw.28 for ; Fri, 24 Oct 2014 12:37:06 -0700 (PDT) X-Received: by 10.140.43.244 with SMTP id e107mr8903381qga.10.1414179426349; Fri, 24 Oct 2014 12:37:06 -0700 (PDT) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id l52sm4864246qgf.43.2014.10.24.12.37.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Oct 2014 12:37:05 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Fri, 24 Oct 2014 15:36:59 -0400 Message-Id: <1414179419-64228-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Subject: [lng-odp] [PATCH] odp_atomic_test.c: Bounds check commandline X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Additional check for impossible negative number of threads Signed-off-by: Mike Holmes --- test/api_test/odp_atomic_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/api_test/odp_atomic_test.c b/test/api_test/odp_atomic_test.c index 9019d4f..d92a8c1 100644 --- a/test/api_test/odp_atomic_test.c +++ b/test/api_test/odp_atomic_test.c @@ -318,12 +318,13 @@ int main(int argc, char *argv[]) goto err_exit; } if (test_type < TEST_MIX || test_type > TEST_MAX || - pthrdnum > odp_sys_core_count()) { + pthrdnum > odp_sys_core_count() || pthrdnum < 0) { usage(); goto err_exit; } cnt -= 2; } + if (pthrdnum == 0) pthrdnum = odp_sys_core_count();