From patchwork Thu Sep 11 01:10:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 37221 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0282320293 for ; Thu, 11 Sep 2014 01:11:17 +0000 (UTC) Received: by mail-oi0-f72.google.com with SMTP id v63sf12095758oia.7 for ; Wed, 10 Sep 2014 18:11:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=u4n8+deMnIEA49VbAoQMLPaY3v/dELMhjQ/gomXmvEA=; b=esSvQ1HAt1xlaWZa/H8QcEyjvuip5FsxVw31j44G7t9XBRqiQ3zaqwPwzLXq23JoVh +uGNy6ogGld2nXS6siwNsg5jGdBKCkAG0S4437g5BPlD0oEByq3inhLQ7N+wBO4yd9bX s9F0g/OWeC6RZmiplyvVTkl/d91GqMWATnyacqPm1vUVCfw6odBxUa15wZZhT3dYn0AG UCJKzK+th6XwU+RV56NGuuFJSjc1zYyj1VuCRa8PdZ6+yXQVkT3YlackUMUnc7zdRK8h 4n7dN5x9mDc0ftIVRBqWPl7E1EbCwB5slRn6Pq9kODjXrHLCQcjuFToX9+YTikHkPtjV D/kg== X-Gm-Message-State: ALoCoQl1rjdEilKs1nAUMPv+CDFW+e5UAR4KMD3F4JZPwtb3KTfG0R3RlHCKKbnuF/9E1GVSH8+e X-Received: by 10.42.62.73 with SMTP id x9mr28666185ich.15.1410397877325; Wed, 10 Sep 2014 18:11:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.34 with SMTP id y31ls1563857qgd.2.gmail; Wed, 10 Sep 2014 18:11:17 -0700 (PDT) X-Received: by 10.52.28.146 with SMTP id b18mr11943056vdh.55.1410397877241; Wed, 10 Sep 2014 18:11:17 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id l2si7679533vdx.44.2014.09.10.18.11.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Sep 2014 18:11:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hy10so5773511vcb.17 for ; Wed, 10 Sep 2014 18:11:17 -0700 (PDT) X-Received: by 10.52.148.2 with SMTP id to2mr19435758vdb.38.1410397877163; Wed, 10 Sep 2014 18:11:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp517380vcb; Wed, 10 Sep 2014 18:11:16 -0700 (PDT) X-Received: by 10.140.29.35 with SMTP id a32mr65114715qga.39.1410397876667; Wed, 10 Sep 2014 18:11:16 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id j52si20717203qga.27.2014.09.10.18.11.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 10 Sep 2014 18:11:16 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XRsup-0000U8-E8; Thu, 11 Sep 2014 01:11:15 +0000 Received: from mail-pa0-f49.google.com ([209.85.220.49]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XRsuc-0000TG-2i for lng-odp@lists.linaro.org; Thu, 11 Sep 2014 01:11:02 +0000 Received: by mail-pa0-f49.google.com with SMTP id lf10so6764922pab.8 for ; Wed, 10 Sep 2014 18:10:56 -0700 (PDT) X-Received: by 10.70.133.170 with SMTP id pd10mr9190760pdb.140.1410397856497; Wed, 10 Sep 2014 18:10:56 -0700 (PDT) Received: from kamensky-w530.cisco.com.net ([24.6.79.41]) by mx.google.com with ESMTPSA id ju4sm15614063pbc.6.2014.09.10.18.10.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Sep 2014 18:10:55 -0700 (PDT) From: Victor Kamensky To: lng-odp@lists.linaro.org Date: Wed, 10 Sep 2014 18:10:24 -0700 Message-Id: <1410397827-2758-3-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1410397827-2758-1-git-send-email-victor.kamensky@linaro.org> References: <1410397827-2758-1-git-send-email-victor.kamensky@linaro.org> X-Topics: crypto patch Subject: [lng-odp] [PATCH 2/5] linux-generic: crypto: odp_crypto_session_create in failure set session to invalid X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: victor.kamensky@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 According to odp_crypto_session_create it should either return session handle in session_out out parameter or set it to ODP_CRYPTO_SESSION_INVALID. Genetic crypto implementation did not do that. Fix it by presetting *session_out to ODP_CRYPTO_SESSION_INVALID. Signed-off-by: Victor Kamensky --- platform/linux-generic/odp_crypto.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 8782d99..ef91a34 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -262,9 +262,12 @@ odp_crypto_session_create(odp_crypto_session_params_t *params, int rc; odp_crypto_generic_session_t *session; - /* Default to successful result */ + /* Default return to successful result */ *status = ODP_CRYPTO_SES_CREATE_ERR_NONE; + /* Default session to failure result */ + *session_out = ODP_CRYPTO_SESSION_INVALID; + /* Allocate memory for this session */ session = alloc_session(); if (NULL == session) {