From 71abe09ede7e4a2d6976f27145c1b45d4b96d96b Mon Sep 17 00:00:00 2001 From: Min Liu Date: Mon, 25 Nov 2019 14:09:25 +0800 Subject: [PATCH] qcacld-3.0: Return error when invalid channel is set for SAP For the vendor command QCA_NL80211_VENDOR_SUBCMD_SET_SAP_CONFIG, if invalid channel is specified, wlan driver return success. It should return error for such case. Change-Id: Ic5dbfaf04a41ee75b97ecba52a577e9ebf78dc05 CRs-Fixed: 2573244 --- core/hdd/src/wlan_hdd_cfg80211.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index f06a6f91db4d..8cfdde44fe02 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -10689,6 +10689,7 @@ __wlan_hdd_cfg80211_sap_configuration_set(struct wiphy *wiphy, struct hdd_ap_ctx *ap_ctx; int ret; uint32_t chan_freq = 0; + bool chan_freq_present = false; QDF_STATUS status; hdd_enter(); @@ -10712,15 +10713,17 @@ __wlan_hdd_cfg80211_sap_configuration_set(struct wiphy *wiphy, if (tb[QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_FREQUENCY]) { chan_freq = nla_get_u32( tb[QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_FREQUENCY]); + chan_freq_present = true; } else if (tb[QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_CHANNEL]) { uint32_t config_channel = nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_CHANNEL]); chan_freq = wlan_reg_legacy_chan_to_freq(hdd_ctx->pdev, config_channel); + chan_freq_present = true; } - if (chan_freq) { + if (chan_freq_present) { if (!test_bit(SOFTAP_BSS_STARTED, &hostapd_adapter->event_flags)) { hdd_err("SAP is not started yet. Restart sap will be invalid");