浏览代码

qcacld-3.0: Fix assert due to invalid vdev id in spectral scan req

Assert in firmware due to invalid vdev id in spectral scan
request.

Fix is to check for invalid vdev id before spectral scan
req send to firmware.

Change-Id: I05b2e359a7b2535384fa40276d3aa42469b7ae81
CRs-Fixed: 2259269
Abhinav Kumar 6 年之前
父节点
当前提交
7e1276f02d
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      core/hdd/src/wlan_hdd_spectralscan.c

+ 8 - 0
core/hdd/src/wlan_hdd_spectralscan.c

@@ -54,6 +54,8 @@ static int __wlan_hdd_cfg80211_spectral_scan_start(struct wiphy *wiphy,
 {
 	int ret;
 	struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
+	struct net_device *dev = wdev->netdev;
+	struct hdd_adapter *adapter;
 
 	hdd_enter();
 
@@ -66,6 +68,12 @@ static int __wlan_hdd_cfg80211_spectral_scan_start(struct wiphy *wiphy,
 		return -EPERM;
 	}
 
+	adapter = WLAN_HDD_GET_PRIV_PTR(dev);
+	if (wlan_hdd_validate_session_id(adapter->session_id)) {
+		hdd_err("invalid session id: %d", adapter->session_id);
+		return -EINVAL;
+	}
+
 	ret = wlan_cfg80211_spectral_scan_config_and_start(wiphy,
 					hdd_ctx->hdd_pdev,
 					data, data_len);