From c6d22684e78fa67aebad11ad16c754328a7d2a58 Mon Sep 17 00:00:00 2001 From: Yu Wang Date: Wed, 17 Mar 2021 16:50:01 +0800 Subject: [PATCH] qcacld-3.0: protect the reject ap list with mutex lock Any operation on the reject ap list should be protected by the mutex lock, otherwise, race condition may happen and result in list corruption. Change-Id: Iefe0594a62563d800e85f8f6ebd747ab46c19fcf CRs-Fixed: 2901576 --- components/blacklist_mgr/core/src/wlan_blm_core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/blacklist_mgr/core/src/wlan_blm_core.c b/components/blacklist_mgr/core/src/wlan_blm_core.c index 277cf00c8006..28ba1db4ff0d 100644 --- a/components/blacklist_mgr/core/src/wlan_blm_core.c +++ b/components/blacklist_mgr/core/src/wlan_blm_core.c @@ -918,6 +918,7 @@ void blm_update_reject_ap_list_to_fw(struct wlan_objmgr_psoc *psoc) struct wlan_objmgr_pdev *pdev; struct blm_pdev_priv_obj *blm_ctx; struct blm_psoc_priv_obj *blm_psoc_obj; + QDF_STATUS status; blm_psoc_obj = blm_get_psoc_obj(psoc); if (!blm_psoc_obj) { @@ -938,8 +939,15 @@ void blm_update_reject_ap_list_to_fw(struct wlan_objmgr_psoc *psoc) goto end; } + status = qdf_mutex_acquire(&blm_ctx->reject_ap_list_lock); + if (QDF_IS_STATUS_ERROR(status)) { + blm_err("failed to acquire reject_ap_list_lock"); + goto end; + } + cfg = &blm_psoc_obj->blm_cfg; blm_send_reject_ap_list_to_fw(pdev, &blm_ctx->reject_ap_list, cfg); + qdf_mutex_release(&blm_ctx->reject_ap_list_lock); end: wlan_objmgr_pdev_release_ref(pdev, WLAN_MLME_CM_ID);