summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhangq <zhangq@qti.qualcomm.com>2016-04-12 13:26:46 +0800
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-05-05 15:46:48 +0530
commitfa6fc7d4e0888f2a3d9975b4bfd508e5f57a2a66 (patch)
tree3beb17197f15c10febb6ec2162ca5802bed2c985
parent32b572852251db5e63b3471e5723d81cb44ed41f (diff)
qcacld-2.0: Resolve error dereference in smeApi.c
In sme_set_pdev_ht_vht_ies(), ht_vht_cfg will be freed in palSendMBMessage. In sme_set_miracast(), there is dereference before null check. Change-Id: Id67a13c6fb2acaf2444212faf0453891558be202 CRs-Fixed: 1002063
-rw-r--r--CORE/SME/src/sme_common/sme_Api.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 23b3a4ad21f0..559622b0b43d 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -12921,7 +12921,6 @@ void sme_set_pdev_ht_vht_ies(tHalHandle hal, bool enable2x2)
if (eHAL_STATUS_SUCCESS != status) {
smsLog(mac_ctx, LOGE, FL(
"SME_PDEV_SET_HT_VHT_IE msg to PE failed"));
- vos_mem_free(ht_vht_cfg);
}
sme_ReleaseGlobalLock(&mac_ctx->sme);
}
@@ -14697,8 +14696,13 @@ eHalStatus sme_set_miracast(tHalHandle hal, uint8_t filter_type)
uint32_t *val;
tpAniSirGlobal mac_ptr = PMAC_STRUCT(hal);
+ if (NULL == mac_ptr) {
+ VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
+ "%s: Invalid MAC pointer", __func__);
+ return eHAL_STATUS_FAILURE;
+ }
val = vos_mem_malloc(sizeof(*val));
- if (NULL == val || NULL == mac_ptr) {
+ if (NULL == val) {
VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
"%s: Invalid pointer", __func__);
return eHAL_STATUS_E_MALLOC_FAILED;
@@ -14713,8 +14717,8 @@ eHalStatus sme_set_miracast(tHalHandle hal, uint8_t filter_type)
if (!VOS_IS_STATUS_SUCCESS(
vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) {
VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
- "%s: Not able to post WDA_SET_MAS_ENABLE_DISABLE to WMA!",
- __func__);
+ "%s: Not able to post SIR_HAL_SET_MIRACAST to WMA!",
+ __func__);
vos_mem_free(val);
return eHAL_STATUS_FAILURE;
}