summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index cab47699ab02..75838aa6e45a 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -6329,9 +6329,9 @@ static int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
static int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
u8* mac, struct station_info *sinfo)
{
- hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( dev );
- hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
- int ssidlen = pHddStaCtx->conn_info.SSID.SSID.length;
+ hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
+ hdd_station_ctx_t *pHddStaCtx;
+ int ssidlen;
tANI_U8 rate_flags;
hdd_context_t *pHddCtx = (hdd_context_t*) wiphy_priv(wiphy);
@@ -6359,6 +6359,27 @@ static int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, struct net_device
ENTER();
+ if (pHddCtx->isLogpInProgress)
+ {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ "%s:LOGP in Progress. Ignore!!!", __func__);
+ return -EAGAIN;
+ }
+
+ if (NULL == pAdapter)
+ {
+ hddLog(VOS_TRACE_LEVEL_FATAL, "%s: pAdapter is NULL!", __func__);
+ return -EINVAL;;
+ }
+
+ pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
+ if (NULL == pHddStaCtx)
+ {
+ hddLog(VOS_TRACE_LEVEL_FATAL, "%s: pHddStaCtx is NULL!", __func__);
+ return -EINVAL;;
+ }
+
+ ssidlen = pHddStaCtx->conn_info.SSID.SSID.length;
if ((eConnectionState_Associated != pHddStaCtx->conn_info.connState) ||
(0 == ssidlen))
{
@@ -6368,13 +6389,6 @@ static int wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, struct net_device
return 0;
}
- if ( (WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress )
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
- "%s:LOGP in Progress. Ignore!!!", __func__);
- return -EAGAIN;
- }
-
wlan_hdd_get_rssi(pAdapter, &sinfo->signal);
sinfo->filled |= STATION_INFO_SIGNAL;