From patchwork Wed Jan 18 22:05:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 91834 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp894qgi; Wed, 18 Jan 2017 14:11:10 -0800 (PST) X-Received: by 10.55.15.234 with SMTP id 103mr5578908qkp.282.1484777469959; Wed, 18 Jan 2017 14:11:09 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id a1si1244633qkf.34.2017.01.18.14.11.09; Wed, 18 Jan 2017 14:11:09 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9C80D61A5B; Wed, 18 Jan 2017 22:11:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 4F98C62B8A; Wed, 18 Jan 2017 22:08:37 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C7D8762B8A; Wed, 18 Jan 2017 22:08:27 +0000 (UTC) Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com [209.85.218.43]) by lists.linaro.org (Postfix) with ESMTPS id A826E60741 for ; Wed, 18 Jan 2017 22:05:20 +0000 (UTC) Received: by mail-oi0-f43.google.com with SMTP id j15so14749959oih.2 for ; Wed, 18 Jan 2017 14:05:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PRXiKux4nY2UqyaMQVSbXro+JaN2NRnxR9tQznA8AsQ=; b=H4+RCh73kh+x/TizlfH7xXDwpyxxszJaoEKy08Gd+RDtuN53YxJd8zC04i3zwSWfYL EJeqf/W3/i/+cRW6mcWMYgA5EFLheGvhkok5Im8Vq9GU0stV9Myy8NJSOIK+sViF7zlq mW94Of3pfUoDMa7MjSHzMUYsQcbpmXf+N7nt7UEJN4ZnWFYLsPNo4z4JUw6VKmEmOcPH vHP0PbA+gJbmrN1KRPoK4dg/guF/PHBJ3LOjibUfpHX3D1RVPl+TrrDP5ku2Je2Uap6T 4pRVeCQu013qRxKhrDa+H6b75leO+99wnwZ3TPx8qH7OtGa1pszKo/aIGOeADP7vcX0V Fvxg== X-Gm-Message-State: AIkVDXJMdsAPfcMFWm2QZNqL2lk9OU3SyF/5LEi/CPAKmAYtht82oxC+MKmo5ZB0ZcokRUc/BIA= X-Received: by 10.202.186.7 with SMTP id k7mr2500124oif.206.1484777120043; Wed, 18 Jan 2017 14:05:20 -0800 (PST) Received: from localhost.localdomain (cpe-70-121-83-241.austin.res.rr.com. [70.121.83.241]) by smtp.gmail.com with ESMTPSA id q88sm840591ota.5.2017.01.18.14.05.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jan 2017 14:05:19 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Wed, 18 Jan 2017 16:05:16 -0600 Message-Id: <20170118220516.28542-1-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.9.3 Subject: [lng-odp] [PATCH] linux-generic: pool: add odp_pool_capability() rc check X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2826 by adding an explicit check of the rc from odp_pool_capability() for consistency with other code that calls this routine. Signed-off-by: Bill Fischofer --- platform/linux-generic/odp_pool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.9.3 diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 090a55f..3a93554 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -445,7 +445,8 @@ static int check_params(odp_pool_param_t *params) { odp_pool_capability_t capa; - odp_pool_capability(&capa); + if (odp_pool_capability(&capa) < 0) + return -1; switch (params->type) { case ODP_POOL_BUFFER: