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
This commit is contained in:
DARAM SUDHA 2015-03-17 11:55:50 +05:30 • committed by Prakash Dhavali
commit ecf4211368

View file

@ -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;