qcacld-3.0: Use heap memory for station_info instead of stack
qcacld-2.0 to qcacld-3.0 propagation
From kernel 3.19-rc4, size of struct station_info is around 600 bytes,
so stack frame size of such routine use this struct will easily
exceed 1024 bytes, the default value of stack frame size.
So use heap memory for this struct instead.
Change-Id: Ibe8a4f5189fcc9d5554f7a5d851c93be8fa8dbad
CRs-Fixed: 1050323
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c
index d8f35f4..5a40fb0 100644
--- a/core/hdd/src/wlan_hdd_assoc.c
+++ b/core/hdd/src/wlan_hdd_assoc.c
@@ -3292,7 +3292,7 @@
{
hdd_station_ctx_t *pHddStaCtx =
WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
- struct station_info staInfo;
+ struct station_info *stainfo;
hdd_err("IBSS New Peer indication from SME "
"with peerMac " MAC_ADDRESS_STR " BSSID: "
@@ -3322,13 +3322,18 @@
qdf_status, qdf_status);
}
pHddStaCtx->ibss_sta_generation++;
- memset(&staInfo, 0, sizeof(staInfo));
- staInfo.filled = 0;
- staInfo.generation = pHddStaCtx->ibss_sta_generation;
+ stainfo = qdf_mem_malloc(sizeof(*stainfo));
+ if (stainfo == NULL) {
+ hdd_err("memory allocation for station_info failed");
+ return QDF_STATUS_E_NOMEM;
+ }
+ stainfo->filled = 0;
+ stainfo->generation = pHddStaCtx->ibss_sta_generation;
cfg80211_new_sta(pAdapter->dev,
(const u8 *)pRoamInfo->peerMac.bytes,
- &staInfo, GFP_KERNEL);
+ stainfo, GFP_KERNEL);
+ qdf_mem_free(stainfo);
if (eCSR_ENCRYPT_TYPE_WEP40_STATICKEY ==
pHddStaCtx->ibss_enc_key.encType