diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index c65af76cca9c..065615eb8a1d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -16994,6 +16994,12 @@ static int __wlan_hdd_cfg80211_testmode(struct wiphy *wiphy, int buf_len; void *buf; QDF_STATUS status; + + if (hdd_get_conparam() != QDF_GLOBAL_FTM_MODE) { + hdd_err("Device is not in FTM mode"); + return -EINVAL; + } + if (!tb[WLAN_HDD_TM_ATTR_DATA]) { hdd_err("WLAN_HDD_TM_ATTR_DATA attribute is invalid"); return -EINVAL; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 417cf8aaf963..85422b44c0b3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -10979,17 +10979,16 @@ static int __con_mode_handler(const char *kmessage, struct kernel_param *kp, enum tQDF_GLOBAL_CON_MODE curr_mode; enum tQDF_ADAPTER_MODE adapter_mode; + hdd_info("con_mode handler: %s", kmessage); + ret = wlan_hdd_validate_context(hdd_ctx); if (ret) return ret; cds_set_load_in_progress(true); - hdd_debug("con_mode handler: %s", kmessage); ret = param_set_int(kmessage, kp); - - if (!(is_con_mode_valid(con_mode))) { hdd_err("invlaid con_mode %d", con_mode); ret = -EINVAL;