From f878c39090a302488f54bedea30914c8c9c73a50 Mon Sep 17 00:00:00 2001 From: Ananya Barat Date: Fri, 14 Aug 2020 19:29:24 +0530 Subject: [PATCH] qcacmn: Make init of dfs->dfs_soc_obj independent of the macros With the current implementation dfs->dfs_soc_object was initialized in function dfs_agile_soc_obj_init under the macro QCA_SUPPORT_AGILE_DFS and ATH_SUPPORT_ZERO_CAC_DFS both of which are disabled for the low memory profiles. Hence the dfs->dfs_soc_obj was not initialized for these profiles, this led to a crash when the following access was made in dfs_is_true_160mhz_supported and dfs_is_restricted_80p80mhz_supported. psoc = dfs->dfs_soc_obj->psoc Fix this by unconditionally initializing the dfs->dfs_soc_obj in wlan_dfs_pdev_obj_create_notification. Change-Id: I3438464e8efedaf2d62a68bbcf1bda5ee0579deb --- umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c b/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c index 7ff69b3efb14..5619f90c20e5 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c @@ -393,6 +393,7 @@ QDF_STATUS wlan_dfs_pdev_obj_create_notification(struct wlan_objmgr_pdev *pdev, struct wlan_dfs *dfs = NULL; struct wlan_objmgr_psoc *psoc; struct wlan_lmac_if_dfs_tx_ops *dfs_tx_ops; + struct dfs_soc_priv_obj *dfs_soc_obj; uint8_t pdev_id; QDF_STATUS status; bool is_5ghz = false; @@ -453,6 +454,9 @@ QDF_STATUS wlan_dfs_pdev_obj_create_notification(struct wlan_objmgr_pdev *pdev, dfs->dfs_is_offload_enabled = dfs_tx_ops->dfs_is_tgt_offload(psoc); dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs_offload %d", dfs->dfs_is_offload_enabled); + dfs_soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, + WLAN_UMAC_COMP_DFS); + dfs->dfs_soc_obj = dfs_soc_obj; dfs_agile_soc_obj_init(dfs, psoc); if (dfs_attach(dfs) == 1) {