diff mbox

[PATCHv4] linux-generic:release memory during session destroy

Message ID 1458293584-11230-1-git-send-email-balakrishna.garapati@linaro.org
State Accepted
Commit f4404beac33ba8fab6edeb6587067c366cb8d4b1
Headers show

Commit Message

Balakrishna Garapati March 18, 2016, 9:33 a.m. UTC
v2:Added the whitespace after if.
v3:link to the bug that this patch resolves.
   https://bugs.linaro.org/show_bug.cgi?id=2127
v4:formating fixes

Signed-off-by: balakrishna.garapati <balakrishna.garapati@linaro.org>
Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
---
 platform/linux-generic/odp_crypto.c | 2 ++
 1 file changed, 2 insertions(+)

--
1.9.1

Comments

Maxim Uvarov March 18, 2016, 10:21 a.m. UTC | #1
Merged

On 03/18/16 12:33, balakrishna.garapati wrote:
> v2:Added the whitespace after if.
> v3:link to the bug that this patch resolves.
>     https://bugs.linaro.org/show_bug.cgi?id=2127
> v4:formating fixes

this changes has to be

> Signed-off-by: balakrishna.garapati <balakrishna.garapati@linaro.org>
> Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
> ---

here. I.e. under ---. In that case git am will skip that lines from 
final patch.

Maxim.

>   platform/linux-generic/odp_crypto.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c
> index 08b479d..7448575 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;
> --
> 1.9.1
>
diff mbox

Patch

diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c
index 08b479d..7448575 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;