Skip to content

Commit

Permalink
Staging: rtl8192e: off by one in rtl8192_get_channel_map()
Browse files Browse the repository at this point in the history
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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Sep 27, 2011
1 parent 06bc696 commit 8f019bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/rtl8192e/rtl_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ static short rtl8192_get_channel_map(struct net_device *dev)
return -1;
}

if (priv->ChannelPlan > COUNTRY_CODE_MAX) {
if (priv->ChannelPlan >= COUNTRY_CODE_MAX) {
printk(KERN_INFO "rtl819x_init:Error channel plan! Set to "
"default.\n");
priv->ChannelPlan = COUNTRY_CODE_FCC;
Expand Down

0 comments on commit 8f019bf

Please sign in to comment.