summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManjeet Singh <manjee@codeaurora.org>2016-11-03 15:43:56 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2016-11-06 09:13:03 -0800
commit37bc617262105ebdc98d768941491ca8645445f0 (patch)
treed1262b27e480ccc5ac049f9281709b0a84d8f789
parent1454b68c18fa3cab4790bd98aae766bac2dfc13c (diff)
qcacld-3.0: Fix 32-bit compilation errors
In function wlan_hdd_set_channel, frame size exceeds 1024 bytes due to static allocation of structure giving compilation error for 32-bit compilers. To avoid frame size compilation error use dynamic allocation instead of static allocation. CRs-Fixed: 1085499 Change-Id: I351e08b74d1bd2b3ff9813de94e76af63b7acc94
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 804b5e47328e..696b25da6e84 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -6087,7 +6087,7 @@ int wlan_hdd_set_channel(struct wiphy *wiphy,
hdd_context_t *pHddCtx;
int status;
- tSmeConfigParams smeConfig;
+ tSmeConfigParams *sme_config;
tsap_Config_t *sap_config;
ENTER();
@@ -6208,12 +6208,17 @@ int wlan_hdd_set_channel(struct wiphy *wiphy,
sap_config->channel = channel;
sap_config->ch_params.center_freq_seg1 = channel_seg2;
- qdf_mem_zero(&smeConfig, sizeof(smeConfig));
- sme_get_config_param(pHddCtx->hHal, &smeConfig);
+ sme_config = qdf_mem_malloc(sizeof(*sme_config));
+
+ if (!sme_config) {
+ hdd_err("Unable to allocate memory for smeconfig!");
+ return -ENOMEM;
+ }
+ sme_get_config_param(pHddCtx->hHal, sme_config);
switch (channel_type) {
case NL80211_CHAN_HT20:
case NL80211_CHAN_NO_HT:
- smeConfig.csrConfig.obssEnabled = false;
+ sme_config->csrConfig.obssEnabled = false;
sap_config->sec_ch = 0;
break;
case NL80211_CHAN_HT40MINUS:
@@ -6224,11 +6229,14 @@ int wlan_hdd_set_channel(struct wiphy *wiphy,
break;
default:
hdd_err("Error!!! Invalid HT20/40 mode !");
+ qdf_mem_free(sme_config);
return -EINVAL;
}
- smeConfig.csrConfig.obssEnabled = wlan_hdd_get_sap_obss(
- pAdapter);
- sme_update_config(pHddCtx->hHal, &smeConfig);
+ sme_config->csrConfig.obssEnabled =
+ wlan_hdd_get_sap_obss(pAdapter);
+
+ sme_update_config(pHddCtx->hHal, sme_config);
+ qdf_mem_free(sme_config);
}
} else {
hdd_err("Invalid device mode failed to set valid channel");