mwifiex: limit channel number not to overflow memory
Limit the channel number in scan request, or the driver scan config structure memory will be overflowed. Cc: <stable@vger.kernel.org> # 3.5+ Signed-off-by: Stone Piao <piaoyun@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
b0bb9b392d
commit
901ceba4e8
1 changed files with 2 additions and 1 deletions
|
@ -1892,7 +1892,8 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy,
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < request->n_channels; i++) {
|
||||
for (i = 0; i < min_t(u32, request->n_channels,
|
||||
MWIFIEX_USER_SCAN_CHAN_MAX); i++) {
|
||||
chan = request->channels[i];
|
||||
priv->user_scan_cfg->chan_list[i].chan_number = chan->hw_value;
|
||||
priv->user_scan_cfg->chan_list[i].radio_type = chan->band;
|
||||
|
|
Loading…
Reference in a new issue