summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Brown <dustinb@codeaurora.org>2017-01-23 17:17:32 -0800
committerqcabuildsw <qcabuildsw@localhost>2017-01-24 11:39:06 -0800
commit0d99fa7e052b15609e571966973b97351974054a (patch)
tree86561653f65878006154bc8def4e905223ed0864
parent9ea1e4c6d1454f11ee4fe99383bc6eaaab06e40f (diff)
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
-rw-r--r--core/hdd/src/wlan_hdd_wext.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index c87e83562df7..7f5ae167d166 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -8332,17 +8332,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))) {