diff --git a/drivers/wifi/nrfwifi/src/fmac_main.c b/drivers/wifi/nrfwifi/src/fmac_main.c index fce5da677223b..82ea0f99267b6 100644 --- a/drivers/wifi/nrfwifi/src/fmac_main.c +++ b/drivers/wifi/nrfwifi/src/fmac_main.c @@ -453,6 +453,8 @@ void reg_change_callbk_fn(void *vif_ctx, struct nrf_wifi_ctx_zep *rpu_ctx_zep = NULL; struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL; + LOG_DBG("%s: Regulatory change event received", __func__); + vif_ctx_zep = vif_ctx; if (!vif_ctx_zep) { @@ -472,6 +474,12 @@ void reg_change_callbk_fn(void *vif_ctx, return; } + if (!fmac_dev_ctx->waiting_for_reg_event) { + LOG_DBG("%s: Unsolicited regulatory change event", __func__); + /* TODO: Handle unsolicited regulatory change event */ + return; + } + fmac_dev_ctx->reg_change = k_malloc(sizeof(struct nrf_wifi_event_regulatory_change)); if (!fmac_dev_ctx->reg_change) { LOG_ERR("%s: Failed to allocate memory for reg_change", __func__); diff --git a/drivers/wifi/nrfwifi/src/net_if.c b/drivers/wifi/nrfwifi/src/net_if.c index 813691865335c..b8ca8915ff4c9 100644 --- a/drivers/wifi/nrfwifi/src/net_if.c +++ b/drivers/wifi/nrfwifi/src/net_if.c @@ -440,7 +440,7 @@ static void ip_maddr_event_handler(struct net_if *iface, ret = k_mutex_lock(&vif_ctx_zep->vif_lock, K_FOREVER); if (ret != 0) { LOG_ERR("%s: Failed to lock vif_lock", __func__); - goto out; + return; } rpu_ctx_zep = vif_ctx_zep->rpu_ctx_zep; @@ -455,7 +455,7 @@ static void ip_maddr_event_handler(struct net_if *iface, if (!mcast_info) { LOG_ERR("%s: Unable to allocate memory of size %d " "for mcast_info", __func__, sizeof(*mcast_info)); - return; + goto unlock; } switch (addr->family) { @@ -492,9 +492,8 @@ static void ip_maddr_event_handler(struct net_if *iface, sizeof(mac_string_buf))); } unlock: - k_mutex_unlock(&vif_ctx_zep->vif_lock); -out: k_free(mcast_info); + k_mutex_unlock(&vif_ctx_zep->vif_lock); } #endif /* CONFIG_NRF70_STA_MODE */ diff --git a/drivers/wifi/nrfwifi/src/shim.h b/drivers/wifi/nrfwifi/src/shim.h index a4162bf89314a..be26fd6355e62 100644 --- a/drivers/wifi/nrfwifi/src/shim.h +++ b/drivers/wifi/nrfwifi/src/shim.h @@ -19,7 +19,6 @@ /** * struct zep_shim_bus_qspi_priv - Structure to hold context information for the Linux OS * shim. - * @opriv: Pointer to OSAL context. * @pcie_callbk_data: Callback data to be passed to the PCIe callback functions. * @pcie_prb_callbk: The callback function to be called when a PCIe device * has been probed. diff --git a/west.yml b/west.yml index a20edb3c48779..84e0c6f4d1c16 100644 --- a/west.yml +++ b/west.yml @@ -188,7 +188,7 @@ manifest: groups: - hal - name: hal_nordic - revision: af91488c6edc4cebaf8b072c8bb258122a055cdb + revision: 5f1210074cb8bb7ec66317af294596a97ac48815 path: modules/hal/nordic groups: - hal