From ecf421136885d18eb66a28fe5ed00efe5f0960da Mon Sep 17 00:00:00 2001 From: DARAM SUDHA Date: Tue, 17 Mar 2015 11:55:50 +0530 Subject: [PATCH] qcacld-3.0: Set tfm to NULL to avoid freeing in crypto_free_cipher qcacld-2.0 to qcacld-3.0 propagation tfm is invalid when alloc fails. Set tfm to NULL to avoid freeing the crypto transform in crypto_free_cipher()->crypto_destroy_tfm. Change-Id: I3261377f3a7b6ab5740d4144be9e84a1a3a07e42 CRs-Fixed: 809085 --- core/cds/src/cds_utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/cds/src/cds_utils.c b/core/cds/src/cds_utils.c index 22f1a9453b7d..cec62590eb18 100644 --- a/core/cds/src/cds_utils.c +++ b/core/cds/src/cds_utils.c @@ -387,6 +387,7 @@ cds_attach_mmie(uint8_t *igtk, uint8_t *ipn, uint16_t key_id, tfm = cds_crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); if (IS_ERR(tfm)) { ret = PTR_ERR(tfm); + tfm = NULL; CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR, "%s: crypto_alloc_cipher failed (%d)", __func__, ret); goto err_tfm; @@ -497,6 +498,7 @@ cds_is_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm, uint8_t *efrm) tfm = cds_crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); if (IS_ERR(tfm)) { ret = PTR_ERR(tfm); + tfm = NULL; CDF_TRACE(CDF_MODULE_ID_CDF, CDF_TRACE_LEVEL_ERROR, "crypto_alloc_cipher failed (%d)", ret); goto err_tfm;