diff --git a/drivers/wifi/nrf700x/osal/fw_if/umac_if/src/event.c b/drivers/wifi/nrf700x/osal/fw_if/umac_if/src/event.c index 2ce4d2a172ff..5d95cb78c03e 100644 --- a/drivers/wifi/nrf700x/osal/fw_if/umac_if/src/event.c +++ b/drivers/wifi/nrf700x/osal/fw_if/umac_if/src/event.c @@ -156,9 +156,6 @@ static enum wifi_nrf_status umac_event_ctrl_process(struct wifi_nrf_fmac_dev_ctx struct wifi_nrf_fmac_dev_ctx_def *def_dev_ctx = NULL; struct wifi_nrf_fmac_priv_def *def_priv = NULL; - def_priv = wifi_fmac_priv(fmac_dev_ctx->fpriv); - def_dev_ctx = wifi_dev_priv(fmac_dev_ctx); - if (!fmac_dev_ctx || !event_data) { wifi_nrf_osal_log_err(fmac_dev_ctx->fpriv->opriv, "%s: Invalid parameters\n", @@ -166,6 +163,13 @@ static enum wifi_nrf_status umac_event_ctrl_process(struct wifi_nrf_fmac_dev_ctx goto out; } + def_priv = wifi_fmac_priv(fmac_dev_ctx->fpriv); + def_dev_ctx = wifi_dev_priv(fmac_dev_ctx); + + if (!def_priv || !def_dev_ctx) { + goto out; + } + umac_hdr = event_data; if_id = umac_hdr->ids.wdev_id; event_num = umac_hdr->cmd_evnt; diff --git a/drivers/wifi/nrf700x/zephyr/src/zephyr_net_if.c b/drivers/wifi/nrf700x/zephyr/src/zephyr_net_if.c index 55d7b1dd2a56..a47908073884 100644 --- a/drivers/wifi/nrf700x/zephyr/src/zephyr_net_if.c +++ b/drivers/wifi/nrf700x/zephyr/src/zephyr_net_if.c @@ -165,6 +165,10 @@ int wifi_nrf_if_send(const struct device *dev, rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; + if (!rpu_ctx_zep->rpu_ctx) { + goto out; + } + if ((vif_ctx_zep->if_carr_state != WIFI_NRF_FMAC_IF_CARR_STATE_ON) || (!vif_ctx_zep->authorized && !is_eapol(pkt))) { goto out; diff --git a/drivers/wifi/nrf700x/zephyr/src/zephyr_wpa_supp_if.c b/drivers/wifi/nrf700x/zephyr/src/zephyr_wpa_supp_if.c index e3b86526081f..c5c2e25b0e97 100644 --- a/drivers/wifi/nrf700x/zephyr/src/zephyr_wpa_supp_if.c +++ b/drivers/wifi/nrf700x/zephyr/src/zephyr_wpa_supp_if.c @@ -859,6 +859,13 @@ int wifi_nrf_wpa_supp_set_key(void *if_priv, const unsigned char *ifname, enum w vif_ctx_zep = if_priv; rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; + /* Can happen in a positive case where "net if down" is completed, but WPA + * supplicant is still deleting keys. + */ + if (!rpu_ctx_zep->rpu_ctx) { + goto out; + } + memset(&key_info, 0, sizeof(key_info)); if (alg != WPA_ALG_NONE) {