Browse Source

qcacld-3.0: Reduce hdd_hostapd_sap_event_cb frame size

In function hdd_hostapd_sap_event_cb frame size exceeds 1024 bytes
due to changes to some structures in msm-4.4 kernel, so compilation
for 32-bit systems might fail
Thus, reduce structure allocations on heap instead of stack in
hdd_hostapd_sap_event_cb.

Change-Id: Ie710afbd6c066a3d770c6c9aac0cfd675ea57f53
CRs-fixed: 1046882
Manjeet Singh 8 years ago
parent
commit
d295b1d8fd
1 changed files with 13 additions and 7 deletions
  1. 13 7
      core/hdd/src/wlan_hdd_hostapd.c

+ 13 - 7
core/hdd/src/wlan_hdd_hostapd.c

@@ -1325,17 +1325,22 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 					      HDD_SAP_WAKE_LOCK_DURATION,
 					      WIFI_POWER_EVENT_WAKELOCK_SAP);
 		{
-			struct station_info staInfo;
+			struct station_info *sta_info;
 			uint16_t iesLen =
 				pSapEvent->sapevt.
 				sapStationAssocReassocCompleteEvent.iesLen;
 
-			memset(&staInfo, 0, sizeof(staInfo));
+			sta_info = qdf_mem_malloc(sizeof(*sta_info));
+			if (!sta_info) {
+				hdd_err("Failed to allocate station info");
+				return QDF_STATUS_E_FAILURE;
+			}
+			memset(sta_info, 0, sizeof(*sta_info));
 			if (iesLen <= MAX_ASSOC_IND_IE_LEN) {
-				staInfo.assoc_req_ies =
+				sta_info->assoc_req_ies =
 					(const u8 *)&pSapEvent->sapevt.
 					sapStationAssocReassocCompleteEvent.ies[0];
-				staInfo.assoc_req_ies_len = iesLen;
+				sta_info->assoc_req_ies_len = iesLen;
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)) && !defined(WITH_BACKPORTS)
 				/*
 				 * After Kernel 4.0, it's no longer need to set
@@ -1343,18 +1348,18 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 				 * changed to use assoc_req_ies_len length to
 				 * check the existance of request IE.
 				 */
-				staInfo.filled |= STATION_INFO_ASSOC_REQ_IES;
+				sta_info->filled |= STATION_INFO_ASSOC_REQ_IES;
 #endif
 				cfg80211_new_sta(dev,
 						 (const u8 *)&pSapEvent->sapevt.
 						 sapStationAssocReassocCompleteEvent.
-						 staMac.bytes[0], &staInfo,
+						 staMac.bytes[0], sta_info,
 						 GFP_KERNEL);
 			} else {
 				hdd_err("Assoc Ie length is too long");
 			}
+			qdf_mem_free(sta_info);
 		}
-
 		pScanInfo = &pHostapdAdapter->scan_info;
 		/* Lets do abort scan to ensure smooth authentication for client */
 		if ((pScanInfo != NULL) && pScanInfo->mScanPending) {
@@ -1746,6 +1751,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 	}
 	wireless_send_event(dev, we_event, &wrqu,
 			    (char *)we_custom_event_generic);
+
 	return QDF_STATUS_SUCCESS;
 
 stopbss: