wlan: Fix NULL pointer dereference in wlan_hdd_tdls_add_station()
Static source code analysis identified an issue in function
wlan_hdd_tdls_add_station() where a pointer that had been positively
checked for NULL could subsequently be dereferenced. Modify the code
so that if the StaParams pointer is NULL processing does not continue.
Change-Id: Ib92c225cb978b05d8750220763e41806f60a8302
CRs-fixed: 470188
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 164142e..2a906d8 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -2778,7 +2778,7 @@
ENTER();
- if (NULL == pHddCtx || NULL == pHddCtx->cfg_ini)
+ if (NULL == pHddCtx || NULL == pHddCtx->cfg_ini || NULL == StaParams)
{
VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
"Invalid arguments");
@@ -2858,7 +2858,7 @@
if (0 == update)
wlan_hdd_tdls_set_link_status(pAdapter, mac, eTDLS_LINK_CONNECTING);
- if (NULL != StaParams)
+ /* debug code */
{
VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL,
"%s: TDLS Peer Parameters.", __func__);
@@ -2882,7 +2882,7 @@
VOS_TRACE(VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL,
"[%d]: %x ", i, StaParams->supported_rates[i]);
}
- }
+ } /* end debug code */
INIT_COMPLETION(pAdapter->tdls_add_station_comp);