Commit 8f019bfe authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

Staging: rtl8192e: off by one in rtl8192_get_channel_map()

COUNTRY_CODE_MAX is not a valid country code.  We're off by one here.
This gets passed to Dot11d_Channelmap() where it's used as an offset
into the ChannelPlan[] array.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 06bc6969
...@@ -1283,7 +1283,7 @@ static short rtl8192_get_channel_map(struct net_device *dev) ...@@ -1283,7 +1283,7 @@ static short rtl8192_get_channel_map(struct net_device *dev)
return -1; return -1;
} }
if (priv->ChannelPlan > COUNTRY_CODE_MAX) { if (priv->ChannelPlan >= COUNTRY_CODE_MAX) {
printk(KERN_INFO "rtl819x_init:Error channel plan! Set to " printk(KERN_INFO "rtl819x_init:Error channel plan! Set to "
"default.\n"); "default.\n");
priv->ChannelPlan = COUNTRY_CODE_FCC; priv->ChannelPlan = COUNTRY_CODE_FCC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment