From deb06bc73b893039f071b4fef4bd94e77f1f4ee6 Mon Sep 17 00:00:00 2001 From: Arun Kumar Khandavalli Date: Tue, 11 Jul 2023 15:44:36 +0530 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_cm_connect.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/hdd/src/wlan_hdd_cm_connect.c b/core/hdd/src/wlan_hdd_cm_connect.c index 580eebc48a..16ec921a59 100644 --- a/core/hdd/src/wlan_hdd_cm_connect.c +++ b/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;