Skip to content

Commit 0b13758

Browse files
committed
[nrf fromlist] drivers: wifi: Fix memory leak in regulatory processing
During Wi-Fi connection UMAC sends an unsolicited regulatory change event but the driver code always assumes that this event is solicited hence doesn't free the memory for the event. Fix this by dropping the unsolicited event as it's not supported yet. Fixes #79733. Upstream PR: zephyrproject-rtos/zephyr#79891 Signed-off-by: Chaitanya Tata <[email protected]>
1 parent 7a6e7c5 commit 0b13758

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/wifi/nrfwifi/src/fmac_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,12 @@ void reg_change_callbk_fn(void *vif_ctx,
474474
return;
475475
}
476476

477+
if (!fmac_dev_ctx->waiting_for_reg_event) {
478+
LOG_DBG("%s: Unsolicited regulatory change event", __func__);
479+
/* TODO: Handle unsolicited regulatory change event */
480+
return;
481+
}
482+
477483
fmac_dev_ctx->reg_change = k_malloc(sizeof(struct nrf_wifi_event_regulatory_change));
478484
if (!fmac_dev_ctx->reg_change) {
479485
LOG_ERR("%s: Failed to allocate memory for reg_change", __func__);

0 commit comments

Comments
 (0)