From c135114baddd6b04bba9809091b548b77e86f3a6 Mon Sep 17 00:00:00 2001 From: Lin Bai Date: Thu, 17 May 2018 11:50:01 +0800 Subject: [PATCH] qcacld-3.0: Fix potential risk of AMSDU config Change "qcacld-3.0: Add support to send A-MSDU aggregation type to firmware" combines the AMSDU/AMPDU configuration path in WMA layer, which is causing some ampdu parameters be overwritten by value of amsdu. Avoid GEN_VDEV_PARAM_AMSDU handler to touch ampdu parameters. CRs-Fixed: 2243571 Change-Id: I52119f2bbcb306f5fad704e912c4cbb179c6a369 --- core/wma/src/wma_main.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index fc9873417263..78f41003a989 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -1182,7 +1182,12 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma, switch (privcmd->param_id) { case GEN_VDEV_PARAM_AMSDU: case GEN_VDEV_PARAM_AMPDU: - if (soc) { + if (!soc) { + WMA_LOGE("%s:SOC context is NULL", __func__); + return; + } + + if (privcmd->param_id == GEN_VDEV_PARAM_AMPDU) { ret = cdp_aggr_cfg(soc, vdev, privcmd->param_value, 0); if (ret) @@ -1191,26 +1196,21 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma, else intr[privcmd->param_vdev_id].config. ampdu = privcmd->param_value; - aggr.vdev_id = vid; - aggr.tx_aggregation_size = - privcmd->param_value; - aggr.rx_aggregation_size = - privcmd->param_value; - if (privcmd->param_id == GEN_VDEV_PARAM_AMSDU) - aggr.aggr_type = - WMI_VDEV_CUSTOM_AGGR_TYPE_AMSDU; - else - aggr.aggr_type = - WMI_VDEV_CUSTOM_AGGR_TYPE_AMPDU; - ret = wma_set_tx_rx_aggregation_size(&aggr); - if (QDF_IS_STATUS_ERROR(ret)) { - WMA_LOGE("set_aggr_size failed ret %d", - ret); - return; - } + aggr.aggr_type = + WMI_VDEV_CUSTOM_AGGR_TYPE_AMPDU; } else { - WMA_LOGE("%s:SOC context is NULL", __func__); + aggr.aggr_type = + WMI_VDEV_CUSTOM_AGGR_TYPE_AMSDU; + } + + aggr.vdev_id = vid; + aggr.tx_aggregation_size = privcmd->param_value; + aggr.rx_aggregation_size = privcmd->param_value; + + ret = wma_set_tx_rx_aggregation_size(&aggr); + if (QDF_IS_STATUS_ERROR(ret)) { + WMA_LOGE("set_aggr_size failed ret %d", ret); return; } break;