diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 8d0761960922..d9d60d5c0695 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -477,6 +477,12 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, if (wlan_hdd_validate_context(hdd_ctx)) return -EINVAL; + if (false == hdd_ctx->config->fEnableTDLSSupport) { + hdd_debug("TDLS Disabled in INI OR not enabled in FW. " + "Cannot process TDLS commands"); + return -ENOTSUPP; + } + if (hdd_ctx->tdls_umac_comp_active) return wlan_cfg80211_tdls_mgmt(hdd_ctx->hdd_pdev, dev, peer, @@ -646,6 +652,12 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, return -EINVAL; } + if (false == hdd_ctx->config->fEnableTDLSSupport) { + hdd_debug("TDLS Disabled in INI OR not enabled in FW. " + "Cannot process TDLS commands"); + return -ENOTSUPP; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_TDLS_OPER, adapter->session_id, oper));