From 7890bebcbcf03dd40e56017b82077047f880eb9f Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Mon, 27 Jan 2020 11:11:03 -0800 Subject: [PATCH] qcacld-3.0: Add sta connection check in NUD stats Add check for sta connection during NUD stats request because FW may assert if NUD stats request is sent to FW when the station is disconnected. Change-Id: I0521356f677154cd5f4f0ae08b5fcfec2e9cef56 CRs-Fixed: 2610267 --- core/hdd/src/wlan_hdd_cfg80211.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index dfb658d295be..9cfcfa384267 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -12830,6 +12830,7 @@ static int __wlan_hdd_cfg80211_set_nud_stats(struct wiphy *wiphy, struct nlattr *tb[STATS_SET_MAX + 1]; struct net_device *dev = wdev->netdev; struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); + struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); struct hdd_context *hdd_ctx = wiphy_priv(wiphy); struct set_arp_stats_params arp_stats_params = {0}; int err = 0; @@ -12856,6 +12857,11 @@ static int __wlan_hdd_cfg80211_set_nud_stats(struct wiphy *wiphy, return -EINVAL; } + if (eConnectionState_Associated != sta_ctx->conn_info.conn_state) { + hdd_debug("Not Associated"); + return 0; + } + err = wlan_cfg80211_nla_parse(tb, STATS_SET_MAX, data, data_len, qca_wlan_vendor_set_nud_stats); if (err) {