summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrunal Soni <ksoni@codeaurora.org>2016-07-11 08:18:53 -0700
committerNandini Suresh <snandini@codeaurora.org>2016-07-18 12:28:11 -0700
commitfd85ba612bf1291689cdd935af3ba2732d9eed61 (patch)
tree2a4bfb7372966f6521a09729a4061a3a33d1f841
parentb86f62603032b7d6e1314987a9a29366202910a3 (diff)
qcacld-3.0: Fix assert in wma_rx_service_ready_ext_event API
In case of legacy/old platform, extended caps are not provided and number of supported hw modes is expected to come as zero. Due to bug in a code, driver is going ahead and try to allocated memory with size of 0 bytes which is causing the assert. Change-Id: I37adf5ba4e1b1100af06da0a37466a5531be5880 CRs-Fixed: 1040063
-rw-r--r--core/wma/src/wma_main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index a0d9e9439805..b1811221c8fd 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -4570,16 +4570,20 @@ static void wma_populate_soc_caps(t_wma_handle *wma_handle,
* first thing to do is to get how many number of hw modes are
* supported and populate in wma_handle global structure
*/
+ if (NULL == param_buf->soc_hw_mode_caps) {
+ WMA_LOGE("%s: Invalid number of hw modes", __func__);
+ return;
+ }
+
qdf_mem_copy(&phy_caps->num_hw_modes,
param_buf->soc_hw_mode_caps,
sizeof(WMI_SOC_MAC_PHY_HW_MODE_CAPS));
if (0 == phy_caps->num_hw_modes.num_hw_modes) {
- WMA_LOGE("%s: Invalid number of hw modes", __func__);
+ WMA_LOGE("%s: Number of hw modes is zero", __func__);
return;
- } else {
- WMA_LOGI("%s: Given number of hw modes[%d]",
- __func__, phy_caps->num_hw_modes.num_hw_modes);
}
+ WMA_LOGI("%s: Given number of hw modes[%d]",
+ __func__, phy_caps->num_hw_modes.num_hw_modes);
/*
* next thing is to allocate the memory to map hw mode to phy/mac caps