Skip to content

Commit

Permalink
nrf_wifi: Fix the NULL checks
Browse files Browse the repository at this point in the history
Fix the NULL checks causing crash during de-init.

Fixes SHEL-2463.

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 authored and rlubos committed Feb 20, 2024
1 parent ce411c0 commit ae13090
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions nrf_wifi/fw_if/umac_if/src/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1477,20 +1477,24 @@ enum nrf_wifi_status (nrf_wifi_fmac_tx_done_event_process)(
struct nrf_wifi_tx_buff_done *config)
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
struct nrf_wifi_fmac_dev_ctx_def *def_dev_ctx = wifi_dev_priv(fmac_dev_ctx);

if (!fmac_dev_ctx) {
goto out;
}
struct nrf_wifi_fmac_dev_ctx_def *def_dev_ctx = NULL;

if (!config) {
if (!fmac_dev_ctx || !config) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
"%s: Invalid parameters",
__func__);

goto out;
}

def_dev_ctx = wifi_dev_priv(fmac_dev_ctx);
if (!def_dev_ctx || !def_dev_ctx->tx_config.tx_lock) {
/* This is a valid case when the TX_DONE event is received
* during the driver deinit, so, silently ignore the failure.
*/
return NRF_WIFI_STATUS_SUCCESS;
}


nrf_wifi_osal_spinlock_take(fmac_dev_ctx->fpriv->opriv,
def_dev_ctx->tx_config.tx_lock);

Expand Down

0 comments on commit ae13090

Please sign in to comment.