From patchwork Wed Sep 17 00:48:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 37498 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 213F42057E for ; Wed, 17 Sep 2014 00:49:36 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id e53sf480957eek.10 for ; Tue, 16 Sep 2014 17:49:35 -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=UJ3UCRYtHvjOmPf+aL4h2jOzGOhZg27SKIlM43I4MHs=; b=Y+6IMjOwR9EQhx35yI6C1a+fiYSUkIkQHU4VHzzujl/bCnua995eB5DEpTW/vjaKKj 3iVFoBWKZsTpOoDydTwLQw27j4qHjzVru7vQjkoC7Ng2b+j1sq6aBzVWc7kn1ctfEHeZ BecGFolL4WTfOSNgJyFWxbpJn2nzVmuHwvTtxXsCPcxQ6WNxmQkUc2/TbF/PweuKkma9 E5st7/Tr/VHqoufS6Hha9JGRMBAZFtcv781B04F3LvgkfedvfCoE7hTYJdWKVyyVtB1u ys8ng1CQneOKnQGMan8bPs4Suf46AMPKSGXRekvnaKlm6Urnu0Kd4Df7oz45IRdBKqvQ 5nQw== X-Gm-Message-State: ALoCoQln8NUW8cPiP4B7Kgi3sZTyeUg/P0+8L50eF7xdAWRwsRiTg1NlM7J+yuNsJpEty/L9HdI8 X-Received: by 10.112.149.67 with SMTP id ty3mr8989408lbb.1.1410914975296; Tue, 16 Sep 2014 17:49:35 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.5.12 with SMTP id ci12ls50917lad.48.gmail; Tue, 16 Sep 2014 17:49:35 -0700 (PDT) X-Received: by 10.112.184.161 with SMTP id ev1mr14090600lbc.82.1410914975158; Tue, 16 Sep 2014 17:49:35 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by mx.google.com with ESMTPS id ir4si26361043lac.116.2014.09.16.17.49.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Sep 2014 17:49:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id w7so862425lbi.18 for ; Tue, 16 Sep 2014 17:49:35 -0700 (PDT) X-Received: by 10.112.87.69 with SMTP id v5mr37936841lbz.15.1410914975095; Tue, 16 Sep 2014 17:49:35 -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.130.169 with SMTP id of9csp493642lbb; Tue, 16 Sep 2014 17:49:34 -0700 (PDT) X-Received: by 10.140.97.247 with SMTP id m110mr54526186qge.80.1410914973948; Tue, 16 Sep 2014 17:49:33 -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 y2si21099916qas.5.2014.09.16.17.49.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Sep 2014 17:49:33 -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 1XU3R6-0000GY-1P; Wed, 17 Sep 2014 00:49:32 +0000 Received: from mail-qc0-f181.google.com ([209.85.216.181]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XU3R0-0000EZ-Gj for lng-odp@lists.linaro.org; Wed, 17 Sep 2014 00:49:26 +0000 Received: by mail-qc0-f181.google.com with SMTP id r5so1028441qcx.26 for ; Tue, 16 Sep 2014 17:49:21 -0700 (PDT) X-Received: by 10.140.100.237 with SMTP id s100mr27916605qge.92.1410914961218; Tue, 16 Sep 2014 17:49:21 -0700 (PDT) Received: from fedora1.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id h2sm13174505qah.35.2014.09.16.17.49.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Sep 2014 17:49:20 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Tue, 16 Sep 2014 20:48:58 -0400 Message-Id: <1410914938-33048-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] odp_linux.c: Call ODP_ERR if malloc fails 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.217.173 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 Signed-off-by: Mike Holmes --- platform/linux-generic/odp_linux.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_linux.c b/platform/linux-generic/odp_linux.c index e21e467..9251ec9 100644 --- a/platform/linux-generic/odp_linux.c +++ b/platform/linux-generic/odp_linux.c @@ -46,7 +46,8 @@ static void *odp_run_start_routine(void *arg) void odph_linux_pthread_create(odph_linux_pthread_t *thread_tbl, int num, - int first_core, void *(*start_routine) (void *), void *arg) + int first_core, + void *(*start_routine) (void *), void *arg) { int i; cpu_set_t cpu_set; @@ -73,6 +74,9 @@ void odph_linux_pthread_create(odph_linux_pthread_t *thread_tbl, int num, sizeof(cpu_set_t), &cpu_set); start_args = malloc(sizeof(odp_start_args_t)); + if (start_args == NULL) + ODP_ERR("Malloc failed"); + memset(start_args, 0, sizeof(odp_start_args_t)); start_args->start_routine = start_routine; start_args->arg = arg;