wlan: Validate device mode before setting LL_STATS
LL_STATS is supported only for STA mode and currently no check
is present to validate the device mode while setting the LL_STATS
from the vendor command.
Allow LL_STATS to be set from the vendor command only for STA mode.
Change-Id: I40e9a6beb20524a84d87105455fe9b28cdc50816
CRs-Fixed: 2364904
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 62ac453..2a0719f 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -2796,6 +2796,14 @@
FL("HDD adapter is Null"));
return -ENODEV;
}
+
+ if (pAdapter->device_mode != WLAN_HDD_INFRA_STATION) {
+ hddLog(VOS_TRACE_LEVEL_DEBUG,
+ "Cannot set LL_STATS for device mode %d",
+ pAdapter->device_mode);
+ return -EINVAL;
+ }
+
/* check the LLStats Capability */
if ( (TRUE != pHddCtx->cfg_ini->fEnableLLStats) ||
(TRUE != sme_IsFeatureSupportedByFW(LINK_LAYER_STATS_MEAS)))