diff options
author | Wen Gong <quic_wgong@quicinc.com> | 2021-11-29 06:09:39 -0500 |
---|---|---|
committer | Kalle Valo <quic_kvalo@quicinc.com> | 2021-12-07 17:20:29 +0200 |
commit | cea7f78d85f3f6ba05f43754600426b0e84abbbd (patch) | |
tree | e3b79bfa1b1a11b875569466dec1fefb194dffec /drivers/net/wireless/ath/ath11k/mac.c | |
parent | 18ae1ab04525507ae5528245a6df004cacd0d39a (diff) | |
download | lwn-cea7f78d85f3f6ba05f43754600426b0e84abbbd.tar.gz lwn-cea7f78d85f3f6ba05f43754600426b0e84abbbd.zip |
ath11k: change to use dynamic memory for channel list of scan
Currently there are about 60 channels for 6 GHz, then the size of
chan_list in struct scan_req_params which is 40 is not enough to
fill all the channel list of 6 GHz.
Use dynamic memory to save the channel list of scan.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20211129110939.15711-1-quic_wgong@quicinc.com
Diffstat (limited to 'drivers/net/wireless/ath/ath11k/mac.c')
-rw-r--r-- | drivers/net/wireless/ath/ath11k/mac.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 0050e2c84888..ffedd22dd1c0 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -3501,6 +3501,14 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw, if (req->n_channels) { arg.num_chan = req->n_channels; + arg.chan_list = kcalloc(arg.num_chan, sizeof(*arg.chan_list), + GFP_KERNEL); + + if (!arg.chan_list) { + ret = -ENOMEM; + goto exit; + } + for (i = 0; i < arg.num_chan; i++) arg.chan_list[i] = req->channels[i]->center_freq; } @@ -3519,6 +3527,8 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw, ATH11K_MAC_SCAN_TIMEOUT_MSECS)); exit: + kfree(arg.chan_list); + if (req->ie_len) kfree(arg.extraie.ptr); |