diff options
| author | Rajeev Kumar <rajekuma@codeaurora.org> | 2017-10-18 22:24:42 -0700 |
|---|---|---|
| committer | Rajeev Kumar <rajekuma@codeaurora.org> | 2017-10-19 14:33:51 -0700 |
| commit | 952314a089976ed5332e54f9f7ec889c2d34e2dd (patch) | |
| tree | d1d6299ffd570a8248512b9283e821db9ec56c8d | |
| parent | 6e4d4f87b5642d2f1fee8b3c2d8dae105ef450de (diff) | |
qcacld-3.0: Add sta_id check before updating sta adapater array
Add sta_id check before updating sta adapater array
Change-Id: Ic2beadbf07d5071e2d9c69e04f178df39ab64136
CRs-Fixed: 2129645
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 4 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_assoc.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 98e3709da4e9..423163222a62 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -185,6 +185,8 @@ #define MAX_GENIE_LEN (512) #define MIN_GENIE_LEN (2) +#define HDD_MAX_STA_COUNT (WLAN_MAX_STA_COUNT + QDF_MAX_NO_OF_SAP_MODE + 2) + #define WLAN_CHIP_VERSION "WCNSS" #define hdd_log_ratelimited(rate, level, args...) \ @@ -1723,7 +1725,7 @@ struct hdd_context_s { /* One per STA: 1 for BCMC_STA_ID, 1 for each SAP_SELF_STA_ID, * 1 for WDS_STAID */ - hdd_adapter_t *sta_to_adapter[WLAN_MAX_STA_COUNT + QDF_MAX_NO_OF_SAP_MODE + 2]; + hdd_adapter_t *sta_to_adapter[HDD_MAX_STA_COUNT]; /** Pointer for firmware image data */ const struct firmware *fw; diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index f272df193063..52f5c5b9287e 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1682,7 +1682,8 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, sme_remove_bssid_from_scan_list(pHddCtx->hHal, pHddStaCtx->conn_info.bssId.bytes); } - pHddCtx->sta_to_adapter[sta_id] = NULL; + if (sta_id < HDD_MAX_STA_COUNT) + pHddCtx->sta_to_adapter[sta_id] = NULL; } /* Clear saved connection information in HDD */ hdd_conn_remove_connect_info(pHddStaCtx); |
