summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManjunathappa Prakash <prakashpm@codeaurora.org>2017-03-07 18:50:33 -0800
committerPrakash Dhavali <pdhavali@codeaurora.org>2017-03-09 21:08:40 -0800
commita8ce0c5aa4f33037c64a584eb2d61e48a047d718 (patch)
tree8d281fda7d7a769768383edfef04adb96231e475
parent6eb2adc7e84c42f4ec39037e0ea323254e751f56 (diff)
qcacld-3.0: Fail monitor mode set channel if it is invalid channel for country
Monitor mode channel set operation derives invalid channel width if we try to set not allowed channel for country code, make sure to return failure instead of going ahead with invalid channel width. Change-Id: I498555a9c90497ef225f536c904b8e7ea8f8d4a2 CRs-Fixed: 2016185
-rw-r--r--core/hdd/src/wlan_hdd_wext.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index 350265ab6e96..903fc0605a3d 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -12226,6 +12226,10 @@ static int wlan_hdd_set_mon_chan(hdd_adapter_t *adapter, uint32_t chan,
ch_params.ch_width = bandwidth;
cds_set_channel_params(chan, 0, &ch_params);
+ if (ch_params.ch_width == CH_WIDTH_INVALID) {
+ hdd_err("Invalid capture channel or bandwidth for a country");
+ return -EINVAL;
+ }
status = sme_roam_channel_change_req(hal_hdl, bssid, &ch_params,
&roam_profile);
if (status) {