wlan: Fix null pointer references found in static analysis.
Fixed potential null pointer references and
memory leaks find by static code analysis.
Change-Id: Ib13533257a23fb0801a287a256a9faa5c7ffa4f4
CRs-Fixed: 594219
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 92b90be..27d3e8c 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -4095,8 +4095,7 @@
((ie_length != 0) ? (const char *)&bss_desc->ieFields: NULL);
unsigned int freq;
struct ieee80211_channel *chan;
- struct ieee80211_mgmt *mgmt =
- kzalloc((sizeof (struct ieee80211_mgmt) + ie_length), GFP_KERNEL);
+ struct ieee80211_mgmt *mgmt = NULL;
struct cfg80211_bss *bss_status = NULL;
size_t frame_len = sizeof (struct ieee80211_mgmt) + ie_length;
int rssi = 0;
@@ -4127,7 +4126,7 @@
return NULL;
}
-
+ mgmt = kzalloc((sizeof (struct ieee80211_mgmt) + ie_length), GFP_KERNEL);
if (!mgmt)
{
VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,