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
This commit is contained in:
Manjeet Singh 2016-11-03 15:43:56 +05:30 • committed by Prakash Dhavali
commit aec78b5c9c

View file

@ -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");