diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index f277ce839ddb..bd7bda93ab4d 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2363,11 +2363,12 @@ static int ieee80211_change_bss(struct wiphy *wiphy, } if (params->basic_rates) { - ieee80211_parse_bitrates(&sdata->vif.bss_conf.chandef, + if(ieee80211_parse_bitrates(&sdata->vif.bss_conf.chandef, wiphy->bands[sband->band], params->basic_rates, params->basic_rates_len, - &sdata->vif.bss_conf.basic_rates); + &sdata->vif.bss_conf.basic_rates)) + return -EINVAL; changed |= BSS_CHANGED_BASIC_RATES; ieee80211_check_rate_mask(sdata); }