diff options
author | Andrew Lutomirski <andy@luto.us> | 2008-01-04 00:03:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-09 02:30:10 -0500 |
commit | 5cdfed54e7200dde2e846e2ef153d1694ce44875 (patch) | |
tree | 99054b3bfdbee3697b990cf9608d81df62d00e8a /net | |
parent | 87c4ac841c1d524416ab36c19689550bf302dab1 (diff) |
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: Andy Lutomirski <luto@myrealbox.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/ieee80211_ioctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 7027eed4d4ae..308bbe4a1333 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c | |||
@@ -591,7 +591,7 @@ static int ieee80211_ioctl_siwrate(struct net_device *dev, | |||
591 | sdata->bss->force_unicast_rateidx = -1; | 591 | sdata->bss->force_unicast_rateidx = -1; |
592 | if (rate->value < 0) | 592 | if (rate->value < 0) |
593 | return 0; | 593 | return 0; |
594 | for (i=0; i< mode->num_rates; i++) { | 594 | for (i=0; i < mode->num_rates; i++) { |
595 | struct ieee80211_rate *rates = &mode->rates[i]; | 595 | struct ieee80211_rate *rates = &mode->rates[i]; |
596 | int this_rate = rates->rate; | 596 | int this_rate = rates->rate; |
597 | 597 | ||
@@ -599,10 +599,10 @@ static int ieee80211_ioctl_siwrate(struct net_device *dev, | |||
599 | sdata->bss->max_ratectrl_rateidx = i; | 599 | sdata->bss->max_ratectrl_rateidx = i; |
600 | if (rate->fixed) | 600 | if (rate->fixed) |
601 | sdata->bss->force_unicast_rateidx = i; | 601 | sdata->bss->force_unicast_rateidx = i; |
602 | break; | 602 | return 0; |
603 | } | 603 | } |
604 | } | 604 | } |
605 | return 0; | 605 | return -EINVAL; |
606 | } | 606 | } |
607 | 607 | ||
608 | static int ieee80211_ioctl_giwrate(struct net_device *dev, | 608 | static int ieee80211_ioctl_giwrate(struct net_device *dev, |