wlan: Use proper length to send the beacon/probe to kernel

propagation from qcacld-3.0 to prima.

Currently sizeof(struct ieee80211_mgmt) + IE len is used to calculate
the total frame length to send the beacon/probe to kernel.
struct ieee80211_mgmt contains union to define different frames and
thus the sizeof(struct ieee80211_mgmt) may give extra length for
beacon/probe if any of the union size is greater than the probe/beacon
union size. This result in trail of zeroes at the end of the frame.

To fix this use sizeof(mgmt_mac_header) + SIR_MAC_B_PR_SSID_OFFSET +
ie len to determine the exact size of the frame.

Change-Id: I71e94b111f36fcd4060befcae282f1fcce5e17f1
CRs-Fixed: 2251716
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 2196083..0f19b58 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -14257,7 +14257,8 @@
     struct ieee80211_channel *chan;
     struct ieee80211_mgmt *mgmt = NULL;
     struct cfg80211_bss *bss_status = NULL;
-    size_t frame_len = sizeof (struct ieee80211_mgmt) + ie_length;
+    size_t frame_len = sizeof(tSirMacMgmtHdr) + SIR_MAC_B_PR_SSID_OFFSET +
+                       ie_length;
     int rssi = 0;
     hdd_context_t *pHddCtx;
     int status;
@@ -14273,7 +14274,7 @@
         return NULL;
     }
 
-    mgmt = kzalloc((sizeof (struct ieee80211_mgmt) + ie_length), GFP_KERNEL);
+    mgmt = kzalloc(frame_len, GFP_KERNEL);
     if (!mgmt)
     {
         VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,