From patchwork Mon May 22 22:00:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 100336 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp50187qge; Mon, 22 May 2017 15:17:36 -0700 (PDT) X-Received: by 10.200.39.65 with SMTP id h1mr25094048qth.62.1495491456672; Mon, 22 May 2017 15:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495491456; cv=none; d=google.com; s=arc-20160816; b=Mvlrbfur2EWCdV6lHUTJntvFXQVtyumJtm9JRREizdczciEvcbBAJlRgxRIjgSMEMU Xg1QdgAn8am47l6L2RZzJtu/m4ImIEGA0hvjXoFoaOlDb3iR4kSXiepY7zW7GqB4ltzI XepZCIytSdQODROYvrCSNbJ0+eQTozw4IPjIOr11/gldW0KnFNK5KtfW5VMw+pZZvy0D rq054hQD4dri9rHJOwt7T3BjzNPrdI05i0WHnKjH5KptxOE8MKSqXcIu6jHocdLsogBJ /WQGoOK1cFui7GDMfLwxb2FEGbdRom7DMBzTLzUx33lC8suOBmQNe5WKIntyMEBVrJt8 ErRQ== 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=UT+oTXsYJe+KveLLp0MSmQm6lflKH9Sux2JipLMuUg8=; b=MPYGsSzELKPhPMXrV1cIJL7FvulmFuded4Ea40RDKG01iHCQkL0VCTJir9PGSL6AU0 YglGRWrLd30hAnFKSsNEdpfBBxnbTmwQhfSlk71c7C6jXqyiYzj40txtAUlpiDX89cAQ 9bzABdLmgF81jemihSpXH/VJKX+gDFFOv710SZkZNH4BKVFpVX93Ui3DkghJpFP0op6P wydrxzkJhUfl2cKvNtoB+XZ4cUzqoSVPX3oGhhuVbwdJyokgHyRv259gPnpzbpce6gC/ i1R9CUs3koA2LawL2vItePuhfwsFc7FH+aICb5Gd/E4604MJQc5krA2Qcr48D7nVYdKp EXlA== ARC-Authentication-Results: i=1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id l20si19741032qtc.308.2017.05.22.15.17.36; Mon, 22 May 2017 15:17:36 -0700 (PDT) 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=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 4FA85609D0; Mon, 22 May 2017 22:17:36 +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,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 07C6860B2D; Mon, 22 May 2017 22:02:52 +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 0AE8160B2D; Mon, 22 May 2017 22:02:44 +0000 (UTC) Received: from forward3j.cmail.yandex.net (forward3j.cmail.yandex.net [5.255.227.21]) by lists.linaro.org (Postfix) with ESMTPS id 973D5607D7 for ; Mon, 22 May 2017 22:00:33 +0000 (UTC) Received: from smtp3m.mail.yandex.net (smtp3m.mail.yandex.net [77.88.61.130]) by forward3j.cmail.yandex.net (Yandex) with ESMTP id 45EC820DAE for ; Tue, 23 May 2017 01:00:32 +0300 (MSK) Received: from smtp3m.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp3m.mail.yandex.net (Yandex) with ESMTP id 40CB82840EB9 for ; Tue, 23 May 2017 01:00:30 +0300 (MSK) Received: by smtp3m.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ll1QrMKPBI-0UEGCJOU; Tue, 23 May 2017 01:00:30 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 23 May 2017 01:00:09 +0300 Message-Id: <1495490409-30066-21-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1495490409-30066-1-git-send-email-odpbot@yandex.ru> References: <1495490409-30066-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 34 Subject: [lng-odp] [PATCH API-NEXT v2 20/20] test: odp_crypto: bail out if odp_crypto_session_create failed 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: Dmitry Eremin-Solenikov If odp_crypto_session_create() failed, there is no point in checking/freeing session, as it might not have been updated. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 34 (lumag:crypto-update-main-new) ** https://github.com/Linaro/odp/pull/34 ** Patch: https://github.com/Linaro/odp/pull/34.patch ** Base sha: 826ee894aa0ebd09d42a17e1de077c46bc5b366a ** Merge commit sha: 7c49c61063e2d57f049a5436cf12a3c36710bb34 **/ test/common_plat/performance/odp_crypto.c | 44 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/test/common_plat/performance/odp_crypto.c b/test/common_plat/performance/odp_crypto.c index dfc7ce68..8c09f24d 100644 --- a/test/common_plat/performance/odp_crypto.c +++ b/test/common_plat/performance/odp_crypto.c @@ -667,34 +667,32 @@ run_measure_one_config(crypto_args_t *cargs, int rc = 0; if (create_session_from_config(&session, config, cargs)) - rc = -1; - - if (!rc) { - if (cargs->payload_length) { - rc = run_measure_one(cargs, config, &session, - cargs->payload_length, &result); - if (!rc) { - print_result_header(); - print_result(cargs, cargs->payload_length, - config, &result); - } - } else { - unsigned i; + return -1; + if (cargs->payload_length) { + rc = run_measure_one(cargs, config, &session, + cargs->payload_length, &result); + if (!rc) { print_result_header(); - for (i = 0; i < num_payloads; i++) { - rc = run_measure_one(cargs, config, &session, - payloads[i], &result); - if (rc) - break; - print_result(cargs, payloads[i], - config, &result); - } + print_result(cargs, cargs->payload_length, + config, &result); + } + } else { + unsigned i; + + print_result_header(); + for (i = 0; i < num_payloads; i++) { + rc = run_measure_one(cargs, config, &session, + payloads[i], &result); + if (rc) + break; + print_result(cargs, payloads[i], + config, &result); } } - if (session != ODP_CRYPTO_SESSION_INVALID) - odp_crypto_session_destroy(session); + odp_crypto_session_destroy(session); + return rc; }