diff options
author | Stone Piao <piaoyun@marvell.com> | 2013-03-29 19:21:21 -0700 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-04-01 16:02:25 -0400 |
commit | 901ceba4e81e9dd6b4a3c4c37ee22000a6c5c65f (patch) | |
tree | 72682f3108cfb2811f1438147bdcbbb44eaa840d | |
parent | b0bb9b392d17a2ca71651706b5acd6d4fc199cb6 (diff) | |
download | linux-3.10-901ceba4e81e9dd6b4a3c4c37ee22000a6c5c65f.tar.gz linux-3.10-901ceba4e81e9dd6b4a3c4c37ee22000a6c5c65f.tar.bz2 linux-3.10-901ceba4e81e9dd6b4a3c4c37ee22000a6c5c65f.zip |
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>
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index a44023a7bd5..8aaf56ade4d 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c @@ -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; |