diff options
author | Aditya Kodukula <quic_akodukul@quicinc.com> | 2021-01-27 11:16:27 +0530 |
---|---|---|
committer | chenpaul <chenpaul@google.com> | 2021-01-28 16:48:25 +0800 |
commit | efe7adc430c760f75d17a1d3ab3f3e7849cf8ac5 (patch) | |
tree | 218366a90788eff674ad2f80d7336045e8439516 | |
parent | c53a0ae8796914749ed7d47687124e0fd77473ef (diff) | |
download | qca-wfi-host-cmn-efe7adc430c760f75d17a1d3ab3f3e7849cf8ac5.tar.gz |
qcacmn: acquire lock before update connection list
Acquire connection list lock in policy mgr before update the
entry. The "conn_index" maybe changed for a connection entry
if other connection is up or down.
Fix by acquire connection to protect the whole "update" operation.
Change-Id: Ib70198b9abc4564bc9121336e67b4ce40e54ffd6
CRs-Fixed: 2863950
Bug: 177952811
Signed-off-by: Aditya Kodukula <quic_akodukul@quicinc.com>
-rw-r--r-- | umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index c311169e1..890fd9c26 100644 --- a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018, 2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -288,9 +288,9 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc, } conn_index++; } - qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); if (!found) { /* err msg */ + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); policy_mgr_err("can't find vdev_id %d in pm_conc_connection_list", vdev_id); return status; @@ -299,11 +299,13 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc, status = pm_ctx->wma_cbacks.wma_get_connection_info( vdev_id, &conn_table_entry); if (QDF_STATUS_SUCCESS != status) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); policy_mgr_err("can't find vdev_id %d in connection table", vdev_id); return status; } } else { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); policy_mgr_err("wma_get_connection_info is NULL"); return QDF_STATUS_E_FAILURE; } @@ -334,6 +336,8 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc, chain_mask, nss, vdev_id, true, true); + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + return QDF_STATUS_SUCCESS; } |