Skip to content

Commit

Permalink
Add proper NULL checking in deinit
Browse files Browse the repository at this point in the history
Add for both RPU context and FMAC context.

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 committed Dec 5, 2024
1 parent 88d8682 commit 3a84144
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions nrf70_bm_lib/source/nrf70_bm_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,21 @@ int nrf70_fmac_deinit(void)
NRF70_LOG_DBG("Deinitializing FMAC module");

#ifndef CONFIG_NRF70_RADIO_TEST
nrf_wifi_fmac_dev_deinit(nrf70_bm_priv.rpu_ctx_bm.rpu_ctx);
nrf_wifi_fmac_dev_rem(nrf70_bm_priv.rpu_ctx_bm.rpu_ctx);
nrf_wifi_fmac_deinit(nrf70_bm_priv.fmac_priv);
if (nrf70_bm_priv.rpu_ctx_bm.rpu_ctx) {
nrf_wifi_fmac_dev_deinit(nrf70_bm_priv.rpu_ctx_bm.rpu_ctx);
nrf_wifi_fmac_dev_rem(nrf70_bm_priv.rpu_ctx_bm.rpu_ctx);
}
if (nrf70_bm_priv.fmac_priv) {
nrf_wifi_fmac_deinit(nrf70_bm_priv.fmac_priv);
}
#else
nrf_wifi_fmac_deinit_rt(nrf70_bm_priv.fmac_priv);
nrf_wifi_fmac_dev_rem_rt(nrf70_bm_priv.rpu_ctx_bm.rpu_ctx);
nrf_wifi_fmac_deinit_rt(nrf70_bm_priv.fmac_priv);
if (nrf70_bm_priv.rpu_ctx_bm.rpu_ctx) {
nrf_wifi_fmac_dev_deinit_rt(nrf70_bm_priv.rpu_ctx_bm.rpu_ctx);
nrf_wifi_fmac_dev_rem_rt(nrf70_bm_priv.rpu_ctx_bm.rpu_ctx);
}
if (nrf70_bm_priv.fmac_priv) {
nrf_wifi_fmac_deinit_rt(nrf70_bm_priv.fmac_priv);
}
#endif /* CONFIG_NRF70_RADIO_TEST */

nrf70_bm_priv.fmac_priv = NULL;
Expand Down

0 comments on commit 3a84144

Please sign in to comment.