Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wifi: Fix memleak in regulatory processing #1568

Open
wants to merge 2 commits into
base: v2.7-branch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nrf_wifi/fw_if/umac_if/inc/fmac_structs_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ struct nrf_wifi_fmac_dev_ctx {
unsigned int reg_chan_count;
/** Regulatory channel attributes */
struct nrf_wifi_get_reg_chn_info *reg_chan_info;
/** To determine if event is solicited or not */
bool waiting_for_reg_event;
/** Regulatory set status */
int reg_set_status;
/** Regulatory change event */
Expand Down
4 changes: 4 additions & 0 deletions nrf_wifi/fw_if/umac_if/src/fmac_api_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,9 @@ enum nrf_wifi_status nrf_wifi_fmac_set_reg(struct nrf_wifi_fmac_dev_ctx *fmac_de
set_reg_cmd->valid_fields |= NRF_WIFI_CMD_REQ_SET_REG_USER_REG_FORCE;
}

fmac_dev_ctx->reg_set_status = false;
fmac_dev_ctx->waiting_for_reg_event = true;

status = umac_cmd_cfg(fmac_dev_ctx,
set_reg_cmd,
sizeof(*set_reg_cmd));
Expand All @@ -848,6 +851,7 @@ enum nrf_wifi_status nrf_wifi_fmac_set_reg(struct nrf_wifi_fmac_dev_ctx *fmac_de
goto out;
}

fmac_dev_ctx->waiting_for_reg_event = false;
reg_change = fmac_dev_ctx->reg_change;

if (reg_change->intr != exp_initiator) {
Expand Down
Loading