提交 5cdfed54 编写于 作者: A Andrew Lutomirski 提交者: David S. Miller

mac80211: return an error when SIWRATE doesn't match any rate

Currently mac80211 fails silently when trying to set a nonexistent
rate.  Return an error instead.
Signed-Off-By: NAndy Lutomirski <luto@myrealbox.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 87c4ac84
......@@ -591,7 +591,7 @@ static int ieee80211_ioctl_siwrate(struct net_device *dev,
sdata->bss->force_unicast_rateidx = -1;
if (rate->value < 0)
return 0;
for (i=0; i< mode->num_rates; i++) {
for (i=0; i < mode->num_rates; i++) {
struct ieee80211_rate *rates = &mode->rates[i];
int this_rate = rates->rate;
......@@ -599,10 +599,10 @@ static int ieee80211_ioctl_siwrate(struct net_device *dev,
sdata->bss->max_ratectrl_rateidx = i;
if (rate->fixed)
sdata->bss->force_unicast_rateidx = i;
break;
return 0;
}
}
return 0;
return -EINVAL;
}
static int ieee80211_ioctl_giwrate(struct net_device *dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册