aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco/wext.c
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2010-08-21 07:08:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-25 14:33:17 -0400
commit9736ebfe39687f2edde9e97fc188f013a31048f6 (patch)
tree3893f7aa342d82c69307a9a9972908d77b327a2b /drivers/net/wireless/orinoco/wext.c
parent0fb9a9ec27718fbf7fa3153bc94becefb716ceeb (diff)
orinoco: Fix walking past the end of the buffer
Fix walking past the end of the bitrate_table array in the case when the loop counter == BITRATE_TABLE_SIZE. Reported by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: David Kilroy <kilroyd@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco/wext.c')
-rw-r--r--drivers/net/wireless/orinoco/wext.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c
index cf7be1eb612..93505f93bf9 100644
--- a/drivers/net/wireless/orinoco/wext.c
+++ b/drivers/net/wireless/orinoco/wext.c
@@ -589,8 +589,15 @@ static int orinoco_ioctl_getrate(struct net_device *dev,
589 589
590 /* If the interface is running we try to find more about the 590 /* If the interface is running we try to find more about the
591 current mode */ 591 current mode */
592 if (netif_running(dev)) 592 if (netif_running(dev)) {
593 err = orinoco_hw_get_act_bitrate(priv, &bitrate); 593 int act_bitrate;
594 int lerr;
595
596 /* Ignore errors if we can't get the actual bitrate */
597 lerr = orinoco_hw_get_act_bitrate(priv, &act_bitrate);
598 if (!lerr)
599 bitrate = act_bitrate;
600 }
594 601
595 orinoco_unlock(priv, &flags); 602 orinoco_unlock(priv, &flags);
596 603