浏览代码

qcacld-3.0: Add monitor mode check for set_mon_chan command

Currently driver does not check for adapter mode when it receives
set mon chan command, which leads to unexpected behavior when it
receives set mon chan command for non monitor mode adapters.

To address above issue, add a check in driver to avoid set mon
chan command for non monitor mode adapters.

Change-Id: I04f4a0c76823beb10ebfae6489f894ba8a302627
CRs-Fixed: 3175969
Ashish 3 年之前
父节点
当前提交
a1854c8ba0
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      core/hdd/src/wlan_hdd_main.c

+ 5 - 0
core/hdd/src/wlan_hdd_main.c

@@ -8765,6 +8765,11 @@ int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, qdf_freq_t freq,
 		return -EINVAL;
 	}
 
+	if (adapter->device_mode != QDF_MONITOR_MODE) {
+		hdd_err_rl("Not supported, adapter is not in monitor mode");
+		return -EINVAL;
+	}
+
 	/* Verify the BW before accepting this request */
 	ch_width = bandwidth;