소스 검색

qcacld-3.0: take vdev reference before passing the vdev around

While STA is connecting we check if SAP is on any of the dfs
channels passing the vdev without taking vdev reference.

SAP interface can be removed in the other thread resulting in
invalid access. So take the vdev reference before passing the
vdev.

Change-Id: I5e1e24c5c8a3f877143bc2fc1b7a5744452ac9c6
CRs-Fixed: 3541378
Arun Kumar Khandavalli 1 년 전
부모
커밋
deb06bc73b
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      core/hdd/src/wlan_hdd_cm_connect.c

+ 7 - 0
core/hdd/src/wlan_hdd_cm_connect.c

@@ -518,12 +518,19 @@ hdd_get_sap_adapter_of_dfs(struct hdd_context *hdd_ctx)
 			    hdd_ctx->dev_dfs_cac_status != DFS_CAC_IN_PROGRESS)
 				continue;
 
+			wlan_objmgr_vdev_get_ref(link_info->vdev,
+						 WLAN_HDD_ID_OBJ_MGR);
 			chan = wlan_vdev_get_active_channel(link_info->vdev);
 			if (!chan) {
 				hdd_debug("Can not get active channel");
+				wlan_objmgr_vdev_release_ref(link_info->vdev,
+							   WLAN_HDD_ID_OBJ_MGR);
 				continue;
 			}
 
+			wlan_objmgr_vdev_release_ref(link_info->vdev,
+						     WLAN_HDD_ID_OBJ_MGR);
+
 			if (!wlan_reg_is_5ghz_ch_freq(chan->ch_freq))
 				continue;