diff options
| author | DARAM SUDHA <dsudha@qti.qualcomm.com> | 2015-03-17 11:55:50 +0530 |
|---|---|---|
| committer | Prakash Dhavali <pdhavali@codeaurora.org> | 2015-11-23 13:09:10 -0800 |
| commit | ecf421136885d18eb66a28fe5ed00efe5f0960da (patch) | |
| tree | 8ac7cf45ff9273a83bd68fefa15aadb9e8f5980d | |
| parent | 647ef12880894ebd7121d2f1b90330b9111b79fc (diff) | |
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
| -rw-r--r-- | core/cds/src/cds_utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |
