Fix more bugs found during static code analysis
Fix miscellaneous bugs found by static source code analysis
Change-Id: Ia84018c213d4731d51044f84c74407a5aac51326
diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c
index 30fb48d..7984a35 100644
--- a/CORE/HDD/src/wlan_hdd_early_suspend.c
+++ b/CORE/HDD/src/wlan_hdd_early_suspend.c
@@ -640,6 +640,8 @@
wlanRxpFilterParam->setMcstBcstFilter = setfilter;
halStatus = sme_ConfigureRxpFilter(pHddCtx->hHal, wlanRxpFilterParam);
+ if (eHAL_STATUS_SUCCESS != halStatus)
+ vos_mem_free(wlanRxpFilterParam);
if(setfilter && (eHAL_STATUS_SUCCESS == halStatus))
pHddCtx->hdd_mcastbcast_filter_set = TRUE;
}
@@ -715,28 +717,32 @@
if(eHAL_STATUS_SUCCESS == halStatus)
{
pHddCtx->hdd_mcastbcast_filter_set = TRUE;
+ } else {
+ vos_mem_free(wlanSuspendParam);
}
}
static void hdd_conf_resume_ind(hdd_adapter_t *pAdapter)
{
+ eHalStatus halStatus = eHAL_STATUS_FAILURE;
VOS_STATUS vstatus;
hdd_context_t* pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
- tpSirWlanResumeParam wlanResumeParam =
- vos_mem_malloc(sizeof(tSirWlanResumeParam));
-
- if(NULL == wlanResumeParam)
- {
- hddLog(VOS_TRACE_LEVEL_FATAL,
- "%s: vos_mem_alloc failed ", __func__);
- return;
- }
+ tpSirWlanResumeParam wlanResumeParam;
hddLog(VOS_TRACE_LEVEL_INFO,
"%s: send wlan resume indication", __func__);
if (pHddCtx->hdd_mcastbcast_filter_set == TRUE)
{
+ wlanResumeParam = vos_mem_malloc(sizeof(tSirWlanResumeParam));
+
+ if(NULL == wlanResumeParam)
+ {
+ hddLog(VOS_TRACE_LEVEL_FATAL,
+ "%s: vos_mem_alloc failed ", __func__);
+ return;
+ }
+
if (pHddCtx->cfg_ini->fhostArpOffload)
{
vstatus = hdd_conf_hostarpoffload(pAdapter, FALSE);
@@ -756,10 +762,13 @@
wlanResumeParam->configuredMcstBcstFilterSetting =
pHddCtx->cfg_ini->mcastBcastFilterSetting;
}
- sme_ConfigureResumeReq(pHddCtx->hHal, wlanResumeParam);
+ halStatus = sme_ConfigureResumeReq(pHddCtx->hHal, wlanResumeParam);
+ if (eHAL_STATUS_SUCCESS != halStatus)
+ vos_mem_free(wlanResumeParam);
pHddCtx->hdd_mcastbcast_filter_set = FALSE;
}
+
#ifdef WLAN_FEATURE_PACKET_FILTERING
if (pHddCtx->cfg_ini->isMcAddrListFilter)
{