From patchwork Wed Jan 31 14:00:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126357 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp782372ljc; Wed, 31 Jan 2018 06:29:50 -0800 (PST) X-Google-Smtp-Source: AH8x224j3LXjsA5o4q0ss5MPxKOr1nh1ig+unw9s1HalpkVfvm4p6ZDN350MdiPIhuZQIhGBBBxp X-Received: by 10.55.134.193 with SMTP id i184mr46390667qkd.314.1517408990033; Wed, 31 Jan 2018 06:29:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517408990; cv=none; d=google.com; s=arc-20160816; b=fDxDC4adCfZe/6rQ7LOeOie55hBZpp+O8mThvZvbD+x/q6n54pnwrU6Mi0enUG3QIn gDq+22E2BzHNqKG3JfmIcIb3QytqQTktTwn1HZ21ZDzy1kvDihwckr4M8lGR9Pqwyjnj He2d7YXFRIO2E/fcMqpqx+p9jazzW1m2qzBth67QUni5EtpLH2t2/LHrVwgbNbIS9SXw kKmSNkEw/hTRPXZBCn637hz2ObUzct1nv9Ofyi/D7NDv0jruHN5eQQDyYHAlEBdG+8/W 2DXvZICbbOqyy6FnV3+tVGBq9fYquF1blXqsab/YTfZm/zftVGFpalMxn0y6ecJGolJ8 jeHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=1QVZhiGSWgJENHmgk/fjAP74RGFP+Lr+IpPtWShcqxw=; b=R0QUp7Pb1pmxIfIsnPN8WwWGK8FEBquQ2Zw3t6lYtXTmMdfvn6EJd7TltmLj1qAJ3f Fa6MGja89I9nE9fBu+ck1Jf6+Y0XXN25DsT1HWhu/tRrXcjRPdcPvFmAdEh0+nhfhgkl Bx9LYAM0GablI1doexwiB5/gmCXZwr0gvxDOBckYOkLXccCCzmd/GPuXhnGe7uclDzci h80baSoyyHcuNZPGYTB8/A+s8BI70UCLlOtY0F14VAEF5maiqsn5LTViUjqfN5I/QivP szQN0YzIlWLsiK2vUtSgUuhdXv8isPPdUe+N2lwzvzLXgE1ePLm+lzhB/us6i8dPgz3z pkrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id t31si2047642qtg.137.2018.01.31.06.29.49; Wed, 31 Jan 2018 06:29:50 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 61701617E8; Wed, 31 Jan 2018 14:29:49 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 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 7C6BC617D2; Wed, 31 Jan 2018 14:08:16 +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 6556C6181C; Wed, 31 Jan 2018 14:07:57 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id D0342617D1 for ; Wed, 31 Jan 2018 14:02:18 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 0DE9918693E for ; Wed, 31 Jan 2018 17:00:19 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id bAyrhUDfs2-0IZ02bSu; Wed, 31 Jan 2018 17:00:18 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nmVaH0g7bK-0IV4IEgJ; Wed, 31 Jan 2018 17:00:18 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 31 Jan 2018 17:00:09 +0300 Message-Id: <1517407211-19105-10-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517407211-19105-1-git-send-email-odpbot@yandex.ru> References: <1517407211-19105-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 437 Subject: [lng-odp] [PATCH v2 9/11] validation: pktio: don't pass invalid handle to index conversion 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" From: Petri Savolainen Fast path functions cannot be expected to always check against invalid handles. Also a handle that has been closed (or destroyed) must not be passed to any API function. Signed-off-by: Petri Savolainen --- /** Email created from pull request 437 (psavol:master-packet-optim) ** https://github.com/Linaro/odp/pull/437 ** Patch: https://github.com/Linaro/odp/pull/437.patch ** Base sha: b95ccd3db6eeb7358a877541747e06354429acdd ** Merge commit sha: 3c2134ecc18e4fd52cd526b5c067815ca73864cc **/ test/validation/api/pktio/pktio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c index a23641036..b20272ffc 100644 --- a/test/validation/api/pktio/pktio.c +++ b/test/validation/api/pktio/pktio.c @@ -1183,7 +1183,7 @@ void pktio_test_lookup(void) void pktio_test_index(void) { - odp_pktio_t pktio, pktio_inval = ODP_PKTIO_INVALID; + odp_pktio_t pktio; odp_pktio_param_t pktio_param; int ndx; @@ -1195,10 +1195,8 @@ void pktio_test_index(void) ndx = odp_pktio_index(pktio); CU_ASSERT(ndx >= 0); - CU_ASSERT(odp_pktio_index(pktio_inval) < 0); CU_ASSERT(odp_pktio_close(pktio) == 0); - CU_ASSERT(odp_pktio_index(pktio) < 0); } static void pktio_test_print(void)