From patchwork Thu Dec 28 11:00:07 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: 122833 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3301739qgn; Thu, 28 Dec 2017 03:01:21 -0800 (PST) X-Google-Smtp-Source: ACJfBotr9777tg64b+Tz1Kpp6ltXS0IdukCNy4vLI0sfe1Qs8rC1n2/MvitBFX3lyjYU/hyEIwKu X-Received: by 10.237.37.177 with SMTP id x46mr43631758qtc.76.1514458881228; Thu, 28 Dec 2017 03:01:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514458881; cv=none; d=google.com; s=arc-20160816; b=KQZu2LR76Be8OPomgibq7jeU+dNOpEfz4R3x9Piop2zF46YbTt52c8P/dIJeV50tNj 1NQwNzz7lSjicXBaMYlfSdXxUHkgZeQedPBCopfAGwn5BBNS8D39OqvjarI8joKXIR0C EKxKVipEoVlZlbiq3766O5OPI1RWT6+FTUo5/mmqu0xg4FWwjFckXuruALFyq+t+GTQ3 41bm7+Jq4n6pVynF3r99Wnf6gTbFL7Y1nJY9nKw3b7ZwLl2nHXQrQu9YqfcXaKX6grOz S16Eu2WOjf6ni8gP/YUAP72gDGztEwS34h5DDjROu/1T0cuHwLDBabfSNvlvu+T6mpPN NANQ== 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=PZr4pUGRwOPoVvbIGZFhKGwiR9HFr5LAf3xcXfpvRlQ=; b=h4ZlXs8nScym7Nt3Hk3tQFiWpLHOURPe9rcLUrVqL8ClhgUEKnJABASot2tZr1E8Cg c+YWvMYNy8sjDmMxvqiyTpLwAtC01w+P1D6o9qB5yfsCypZq9YOiCOhkp/r3A39rMRNg dO/udNWCns0nwaOPCas9BnXn58ad5IBC80PYw0YaLMnNBlPaDjAZH0/8dqdjAe5zdhsg 4SPAo4P0wVnUv8iTy5pWrzn9U/ReA8WPXWca+AiCA+rG5ZFgCzn6z7RazP1EcHTBN3rK r0+CKQ3qJTybzQPg20/wtWlfqcmVhsOMq0XmA1KAyRfblOb0LGRHcHhTFbiA7ABd9X2w paaw== 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 s87si5950081qki.430.2017.12.28.03.01.20; Thu, 28 Dec 2017 03:01:21 -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 D691E614FF; Thu, 28 Dec 2017 11:01:20 +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 74757609AA; Thu, 28 Dec 2017 11:00:23 +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 54F4E60912; Thu, 28 Dec 2017 11:00:18 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 2AF2D608D4 for ; Thu, 28 Dec 2017 11:00:17 +0000 (UTC) Received: from mxback18j.mail.yandex.net (mxback18j.mail.yandex.net [IPv6:2a02:6b8:0:1619::94]) by forward102o.mail.yandex.net (Yandex) with ESMTP id EF53F5A03B71 for ; Thu, 28 Dec 2017 14:00:10 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback18j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VDEAsKiAVa-0AUaltmP; Thu, 28 Dec 2017 14:00:10 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 5RDKid1QT5-0AMmhCGQ; Thu, 28 Dec 2017 14:00:10 +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: Thu, 28 Dec 2017 14:00:07 +0300 Message-Id: <1514458808-9218-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514458808-9218-1-git-send-email-odpbot@yandex.ru> References: <1514458808-9218-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 376 Subject: [lng-odp] [PATCH API-NEXT v1 1/2] validation: crypto: clean shutdown in case pkt allocation 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 Provide clean shutdown path for the case of odp_packet_alloc() returning ODP_PACKET_INVALID. Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 376 (lumag:test-fixes) ** https://github.com/Linaro/odp/pull/376 ** Patch: https://github.com/Linaro/odp/pull/376.patch ** Base sha: 68735b312926a44ddf42f9ecf96a0badd941a247 ** Merge commit sha: c3ae2320e846c56ecc6040c63336b9e30de0beee **/ test/validation/api/crypto/odp_crypto_test_inp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index f1da6989c..821bdc7e4 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -458,6 +458,8 @@ static void alg_test(odp_crypto_op_t op, odp_packet_t pkt = odp_packet_alloc(suite_context.pool, ref->length + ref->digest_length); CU_ASSERT(pkt != ODP_PACKET_INVALID); + if (pkt == ODP_PACKET_INVALID) + goto cleanup; for (iteration = NORMAL_TEST; iteration < MAX_TEST; iteration++) { /* checking against wrong digest is meaningless for NULL digest @@ -523,10 +525,11 @@ static void alg_test(odp_crypto_op_t op, } } + odp_packet_free(pkt); + +cleanup: rc = odp_crypto_session_destroy(session); CU_ASSERT(!rc); - - odp_packet_free(pkt); } /**