From patchwork Thu Mar 9 12:01:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Eremin-Solenikov X-Patchwork-Id: 95116 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp331127obz; Thu, 9 Mar 2017 04:02:33 -0800 (PST) X-Received: by 10.55.121.134 with SMTP id u128mr14202993qkc.12.1489060953456; Thu, 09 Mar 2017 04:02:33 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id a197si5483022qkb.109.2017.03.09.04.02.32; Thu, 09 Mar 2017 04:02:33 -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 BED6060A1C; Thu, 9 Mar 2017 12:02:32 +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_H3, RCVD_IN_MSPIKE_WL, 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 81E7C6086F; Thu, 9 Mar 2017 12:02:29 +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 7ECD06091D; Thu, 9 Mar 2017 12:02:10 +0000 (UTC) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by lists.linaro.org (Postfix) with ESMTPS id 91EE160A1C for ; Thu, 9 Mar 2017 12:01:09 +0000 (UTC) Received: by mail-wm0-f52.google.com with SMTP id n11so54220898wma.0 for ; Thu, 09 Mar 2017 04:01:09 -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:subject:date:message-id; bh=RFWiXFq0cblzdkA02O5a6f8Jt630Spzx+0uiWbDNnTg=; b=huGAAMenQ1zh5+iCZBWMJakCTtx8ZfC5IJvfX/8ZKe0wIGg1uiuX2yMwPCTNZAz1YM Sy2cXSuU04i+zpjU08mJU1+VHCOM85N7AtW0l6EQtoOVUmQlSXGV13Ve4UQnTCikayXQ D0aJu0o0jC5w0yYPkFV6aOGglYWPLj43uaPzZTL9tXYc132S/3OdrwslpXkI3EyCCuFA zeWxIGhQ4Qsb1SpS50rojIUN4yCpLp0+MHnTrb5dl/I8yOxAEShcM9ePvmM57p80UfwX 8rmVEPo2O1sjSk302qNO2W0shsMepDG6OiUO+eH5Bb1FOLXHA3M+HHO8hwwwGTs81KQ8 1K3g== X-Gm-Message-State: AMke39ma+ngjUyg3akz21MQB7lBvUdALb3GFcZGNqyJ8qc2l333EpXJ+rd3uvvi6wHPdLZg3oLjHqQ== X-Received: by 10.28.72.193 with SMTP id v184mr27585252wma.105.1489060868508; Thu, 09 Mar 2017 04:01:08 -0800 (PST) Received: from forlindon.c.hoisthospitality.com ([109.74.56.122]) by smtp.gmail.com with ESMTPSA id o143sm8584835wmd.3.2017.03.09.04.01.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Mar 2017 04:01:08 -0800 (PST) From: Dmitry Eremin-Solenikov To: lng-odp@lists.linaro.org Date: Thu, 9 Mar 2017 15:01:07 +0300 Message-Id: <20170309120107.26687-1-dmitry.ereminsolenikov@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [lng-odp] [PATCH] linux-generic: pool: don't allocate buffers from invalid pool 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" Check that passed pool is not ODP_POOL_INVALID before goint to try to allocate buffers from that pool. Signed-off-by: Dmitry Eremin-Solenikov --- platform/linux-generic/odp_pool.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.11.0 diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index cf7c2c41..f0b64932 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -768,6 +768,9 @@ odp_buffer_t odp_buffer_alloc(odp_pool_t pool_hdl) pool_t *pool; int ret; + if (ODP_POOL_INVALID == pool_hdl) + return ODP_BUFFER_INVALID; + pool = pool_entry_from_hdl(pool_hdl); ret = buffer_alloc_multi(pool, &buf, NULL, 1);