From patchwork Tue Mar 15 11:03:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balakrishna Garapati X-Patchwork-Id: 63864 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp586517lbc; Tue, 15 Mar 2016 04:04:21 -0700 (PDT) X-Received: by 10.140.96.137 with SMTP id k9mr37277841qge.23.1458039861359; Tue, 15 Mar 2016 04:04:21 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g49si26029907qgf.47.2016.03.15.04.04.20; Tue, 15 Mar 2016 04:04:21 -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 Received: by lists.linaro.org (Postfix, from userid 109) id 8FDF061789; Tue, 15 Mar 2016 11:04: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, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 2B3986178C; Tue, 15 Mar 2016 11:04:13 +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 060B8617E6; Tue, 15 Mar 2016 11:04:07 +0000 (UTC) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by lists.linaro.org (Postfix) with ESMTPS id B871A61789 for ; Tue, 15 Mar 2016 11:04:05 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id x1so17407924lbj.3 for ; Tue, 15 Mar 2016 04:04:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iXlYygdAx+09Y+ivnUlrS1qTJLf/mENMx8hLxK5glLQ=; b=hJ25hHqrO5Cg0VoWr9uhD3TSieFwdu3cxs6olmeM/ZSHtv1FWes7+7EOarRqdgrpTs kNd+Qzbtj7Vp2tmsYfd9t6o4DXxfVsg96PbTTIpxgDvQJ6oA0ifE7i+hMHoeAz7JbZqf rjQXwJbj9ancMKRj8EH8GM8Bcvi4vvLUVYFDbs+ErcUPR63NIGhz5u4LEvs9y5A7pqLo KsH3EpZDsATpcRGIc9r2vcWG6lka/wAOu6nHF6qi15yJWOexohviQb5M3QIpPzAh9OI9 oxABeA5rWEiXxJmucgqkmKAQwGIQAG/DmW4W5tCOepmRjGh8FFKLpTyeJbSbOsiEtBuw topQ== X-Gm-Message-State: AD7BkJIK29F/Xb7Fp0IKmcBLLPTRDXig38Av3RdxpmvsJ+nCwI6bE5oPZXxVupXqdXFElp08Pxo= X-Received: by 10.25.30.73 with SMTP id e70mr9743519lfe.13.1458039843869; Tue, 15 Mar 2016 04:04:03 -0700 (PDT) Received: from elxahtkds32.localdomain (host-95-195-70-39.mobileonline.telia.com. [95.195.70.39]) by smtp.gmail.com with ESMTPSA id g5sm4302304lfe.42.2016.03.15.04.04.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Mar 2016 04:04:03 -0700 (PDT) From: "balakrishna.garapati" To: bala.manoharan@linaro.org, maxim.uvarov@linaro.org Date: Tue, 15 Mar 2016 12:03:56 +0100 Message-Id: <1458039836-30443-1-git-send-email-balakrishna.garapati@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH] linux-generic:release memory during session destory 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: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" make sure the EVP_CIPHER memory is freed from the aes_gcm ctx before memset the crypto session to zero. Signed-off-by: balakrishna.garapati --- platform/linux-generic/odp_crypto.c | 2 ++ 1 file changed, 2 insertions(+) -- 1.9.1 diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 08b479d..07df747 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -704,6 +704,8 @@ int odp_crypto_session_destroy(odp_crypto_session_t session) odp_crypto_generic_session_t *generic; generic = (odp_crypto_generic_session_t *)(intptr_t)session; + if(generic->cipher.alg == ODP_CIPHER_ALG_AES128_GCM) + EVP_CIPHER_CTX_free(generic->cipher.data.aes_gcm.ctx); memset(generic, 0, sizeof(*generic)); free_session(generic); return 0;