Browse Source

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
Manjunathappa Prakash 8 years ago
parent
commit
c4dc9386a2
1 changed files with 4 additions and 0 deletions
  1. 4 0
      core/hdd/src/wlan_hdd_wext.c

+ 4 - 0
core/hdd/src/wlan_hdd_wext.c

@@ -12438,6 +12438,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) {