Skip to content

Commit 168ac3b

Browse files
krish2718rlubos
authored andcommitted
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. Signed-off-by: Chaitanya Tata <[email protected]>
1 parent 62921cf commit 168ac3b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/wifi/nrf700x/src/fmac_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,12 @@ void reg_change_callbk_fn(void *vif_ctx,
448448
return;
449449
}
450450

451+
if (!fmac_dev_ctx->waiting_for_reg_event) {
452+
LOG_DBG("%s: Unsolicited regulatory change event", __func__);
453+
/* TODO: Handle unsolicited regulatory change event */
454+
return;
455+
}
456+
451457
fmac_dev_ctx->reg_change = k_malloc(sizeof(struct nrf_wifi_event_regulatory_change));
452458
if (!fmac_dev_ctx->reg_change) {
453459
LOG_ERR("%s: Failed to allocate memory for reg_change", __func__);

0 commit comments

Comments
 (0)