qcacmn: Check the max value for max desc before using

Check the max value for max desc extracted from cfg
before using it for actual allocation of tx descs.

Change-Id: I9bd6c88f136870a42596afbf25328965fce959be
CRs-fixed: 2614329
这个提交包含在:
Pavankumar Nandeshwar
2020-02-14 17:20:49 +05:30
提交者 nshrivas
父节点 9fae7f7537
当前提交 0d8578f313

查看文件

@@ -4290,7 +4290,12 @@ QDF_STATUS dp_tx_soc_attach(struct dp_soc *soc)
num_desc = wlan_cfg_get_num_tx_desc(soc->wlan_cfg_ctx);
num_ext_desc = wlan_cfg_get_num_tx_ext_desc(soc->wlan_cfg_ctx);
if (num_pool > MAX_TXDESC_POOLS)
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
"%s Tx Desc Alloc num_pool = %d, descs = %d",
__func__, num_pool, num_desc);
if ((num_pool > MAX_TXDESC_POOLS) ||
(num_desc > WLAN_CFG_NUM_TX_DESC_MAX))
goto fail;
if (dp_tx_alloc_static_pools(soc, num_pool, num_desc))
@@ -4298,10 +4303,6 @@ QDF_STATUS dp_tx_soc_attach(struct dp_soc *soc)
dp_tx_flow_control_init(soc);
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
"%s Tx Desc Alloc num_pool = %d, descs = %d",
__func__, num_pool, num_desc);
/* Allocate extension tx descriptor pools */
for (i = 0; i < num_pool; i++) {
if (dp_tx_ext_desc_pool_alloc(soc, i, num_ext_desc)) {