qcacld-3.0: Avoid large stack allocation in getPhyMode ioctl

The getPhyMode ioctl allocates a large struct on the stack. This is
problematic for a number of reasons, and can cause compilation errors.
Migrate the allocation to the heap instead.

Change-Id: I7a1df6bbc89dd169d11a541f1ebcded6136792e9
CRs-Fixed: 1114990
This commit is contained in:
Dustin Brown
2017-01-23 17:17:32 -08:00
committed by qcabuildsw
parent b4f978ad57
commit e9c6b3a24b

View File

@@ -8140,17 +8140,26 @@ static int __iw_get_char_setnone(struct net_device *dev,
tHalHandle hal = WLAN_HDD_GET_HAL_CTX(pAdapter);
eCsrPhyMode phymode;
eCsrBand currBand;
tSmeConfigParams smeconfig;
tSmeConfigParams *sme_config;
sme_get_config_param(hal, &smeconfig);
sme_config = qdf_mem_malloc(sizeof(*sme_config));
if (!sme_config) {
hdd_err("Out of memory");
ret = -ENOMEM;
break;
}
sme_get_config_param(hal, sme_config);
if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE !=
smeconfig.csrConfig.channelBondingMode24GHz)
sme_config->csrConfig.channelBondingMode24GHz)
ch_bond24 = true;
if (WNI_CFG_CHANNEL_BONDING_MODE_DISABLE !=
smeconfig.csrConfig.channelBondingMode5GHz)
sme_config->csrConfig.channelBondingMode5GHz)
ch_bond5g = true;
qdf_mem_free(sme_config);
phymode = sme_get_phy_mode(hal);
if ((QDF_STATUS_SUCCESS !=
sme_get_freq_band(hal, &currBand))) {